循环依赖一般是由bean的相互依赖引起的,改变相应依赖的关糸即可,一般是设计错误。
一般错误说明如下:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cancelBookingService': Bean with name 'cancelBookingService' has been injected into other beans [bookingProxy] in its raw version as part of a [color=red]circular reference[/color], but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
一般错误说明如下:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cancelBookingService': Bean with name 'cancelBookingService' has been injected into other beans [bookingProxy] in its raw version as part of a [color=red]circular reference[/color], but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.