Refrence answer to circular dependencies
Circular dependencies
If you are using predominantly constructor injection it is possible to write and configure your classes and
beans such that an unresolvable circular dependency scenario is created.
Consider the scenario where you have class A, which requires an instance of class B to be provided via
constructor injection, and class B, which requires an instance of class A to be provided via constructor
injection. If you configure beans for classes A and B to be injected into each other, the Spring IoC
container will detect this circular reference at runtime, and throw a
BeanCurrentlyInCreationException.
One possible solution to this issue is to edit the source code of some of your classes to be configured via
setters instead of via constructors. Another solution is not to use constructor injection and stick to setter
injection only.
mmmm, I think I will order a cup of coffee in this beautiful spring day