`

Spring:FactoryBeanNotInitializedException

阅读更多
配个bean,碰到个奇怪的问题:
引用

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'orderService': org.springframework.beans.factory.FactoryBeanNotInitializedException: FactoryBean is not fully initialized yet
at org.springframework.beans.factory.support.AbstractBeanFactory$3.run(AbstractBeanFactory.java:1307)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1272)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:206)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:268)
... 113 more



why?原来是因为配的这两个bean相互引用了;相互引用就会报FactoryBeanNotInitializedException
引用

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException .

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics