Circular Dependency And How To AvoidWhat is a circular dependency?Bean A depends on bean B and bean B depends on bean A.When creating bean A, Spring find it depends on bean B and bean B is not created, so Spring start to create bean B, but when creating bean B, it finds that bean B depends on bean A and and bean A hasn't created, so it will go to create beanA. Thus, there is a cycle. -> This is hypothesis, if Spring doesn't handle the circular dependency. -> Spring don't know which to create first. In these cases, Spring will raise aBeanCurrentlyInCreationExceptionwhile loading context.This ha
...
继续阅读
(29)