org.springframework.web.context.ContextLoader – Context initialization failed
I am getting following exception while starting tomcat. Application context is not loaded after the error. I am using spring framework.
2008-07-02 17:55:19,484 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController' defined in ServletContext resource [/WEB-INF/servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'callCenterService': Bean with name 'callCenterService' has been injected into other beans [centerAccessService] 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. Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'testService': Bean with name 'testService' has been injected into other beans [testAccessService] 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. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
What could be possible reason for this exception?
Comments
One Response to “org.springframework.web.context.ContextLoader – Context initialization failed”
Leave a Reply
This is the case of circular reference. It is like we need bean B to initialize Bean A and We need bean A to initialize bean B. If this is the case then both A, B won’t be initialized.
The solution to this problem is to avoid such case. It might be possible that by mistake you are making such a circular reference.
Check your beans initialization properties.