读书人

Spring 循环倚赖(circular reference)

发布时间: 2012-10-18 13:46:55 作者: rapoo

Spring 循环依赖(circular reference)
循环依赖一般是由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 circular reference, 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.

读书人网 >软件架构设计

热点推荐