org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference

Spring JIRA | Victor | 1 decade ago
  1. 0

    Sometimes FactoryBeanCircularReferenceException will show up if 2 more factory beans in the app context xml are set to use autowire, while there isn't any actual circular reference at all. And the exception will disappear once you arrange the order of the beans to a specific one - no code change is needed. This is unexpected behavior. I managed to reproduce it by using the following: 1) 1 simple business object with 1 simple interface. public class CronJobManagerImpl implements CronJobManager { private String manualTriggerToken; public boolean verifyToken(String token) { return false; } } public interface CronJobManager { public static final String BEAN_NAME = "cronJobManager"; public boolean verifyToken(String token); } 2) a applicationContext.xml as following: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="osarToEdsCronTrigger" /> </list> </property> <property name="waitForJobsToCompleteOnShutdown"> <value>true</value> </property> </bean> <bean id="txManager" class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean" /> <bean id="platformTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager"> <ref local="txManager" /> </property> <property name="userTransactionName"> <value>java:comp/UserTransaction</value> </property> <property name="transactionSynchronizationName"> <value>SYNCHRONIZATION_NEVER</value> </property> </bean> <bean id="osarToEdsJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <ref local="cronJobManager" /> </property> <property name="targetMethod"> <value>toString</value> </property> </bean> <bean id="osarToEdsCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref local="osarToEdsJobDetail" /> </property> <property name="cronExpression"> <value>0 10 23 * * ?</value> </property> </bean> <bean id="cronJobManagerTarget" class="com.cot.cor.osar.cron.bso.CronJobManagerImpl" autowire="byType"> </bean> <bean id="cronJobManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" autowire="byType"> <property name="target"> <ref local="cronJobManagerTarget" /> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> </beans> I load the above inside a web module using spring contextloader, and got the following error: [1/12/05 14:27:47:969 EST] 5f556b79 SystemOut U ERROR [Thread-1] (ContextLoader.java:124) - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsJobDetail' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'cronJobManager' while setting property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsCronTrigger' while setting property 'triggers[0]'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsCronTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsJobDetail' while setting property 'jobDetail'; nested exception is org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsCronTrigger' while setting property 'triggers[0]'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsCronTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsJobDetail' while setting property 'jobDetail'; nested exception is org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsCronTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsJobDetail' while setting property 'jobDetail'; nested exception is org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForSharedInstance(AbstractBeanFactory.java:802) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveManagedList(AbstractAutowireCapableBeanFactory.java:965) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:347) at org.springframework.beans.factory.support.DefaultListableBeanFactory.isBeanTypeMatch(DefaultListableBeanFactory.java:235) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:145) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findMatchingBeans(DefaultListableBeanFactory.java:338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:707) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:641) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:255) at org.springframework.context.support.AbstractApplicationContext.refr [1/12/05 14:27:47:984 EST] 5f556b79 SystemOut U esh(AbstractApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:177) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:105) at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.servlet.engine.webapp.StrictServletInstance.doInit(ServletManager.java:802) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(StrictLifecycleServlet.java:141) at com.ibm.servlet.engine.webapp.PreInitializedServletState.init(StrictLifecycleServlet.java:254) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(StrictLifecycleServlet.java:107) at com.ibm.servlet.engine.webapp.ServletInstance.init(ServletManager.java:388) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.servlet.engine.webapp.ServletManager.addServlet(ServletManager.java:84) at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:193) at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:325) at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:1217) at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:145) at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:259) at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:168) at com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:857) at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:43) at com.ibm.ws.runtime.Server.startModule(Server.java:617) at com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:333) at com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349) at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:884) at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519) at java.lang.reflect.Method.invoke(Native Method) at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158) at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV4$1.run(ServerRunnerV4.java:56) --------- I can eliminate the above error by simply moving the quartzScheduler bean definition from the top of the xml to the last one. I'll attach the testing ear file later.

    Spring JIRA | 1 decade ago | Victor
    org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference
  2. 0

    Sometimes FactoryBeanCircularReferenceException will show up if 2 more factory beans in the app context xml are set to use autowire, while there isn't any actual circular reference at all. And the exception will disappear once you arrange the order of the beans to a specific one - no code change is needed. This is unexpected behavior. I managed to reproduce it by using the following: 1) 1 simple business object with 1 simple interface. public class CronJobManagerImpl implements CronJobManager { private String manualTriggerToken; public boolean verifyToken(String token) { return false; } } public interface CronJobManager { public static final String BEAN_NAME = "cronJobManager"; public boolean verifyToken(String token); } 2) a applicationContext.xml as following: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="osarToEdsCronTrigger" /> </list> </property> <property name="waitForJobsToCompleteOnShutdown"> <value>true</value> </property> </bean> <bean id="txManager" class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean" /> <bean id="platformTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager"> <ref local="txManager" /> </property> <property name="userTransactionName"> <value>java:comp/UserTransaction</value> </property> <property name="transactionSynchronizationName"> <value>SYNCHRONIZATION_NEVER</value> </property> </bean> <bean id="osarToEdsJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <ref local="cronJobManager" /> </property> <property name="targetMethod"> <value>toString</value> </property> </bean> <bean id="osarToEdsCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref local="osarToEdsJobDetail" /> </property> <property name="cronExpression"> <value>0 10 23 * * ?</value> </property> </bean> <bean id="cronJobManagerTarget" class="com.cot.cor.osar.cron.bso.CronJobManagerImpl" autowire="byType"> </bean> <bean id="cronJobManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" autowire="byType"> <property name="target"> <ref local="cronJobManagerTarget" /> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> </beans> I load the above inside a web module using spring contextloader, and got the following error: [1/12/05 14:27:47:969 EST] 5f556b79 SystemOut U ERROR [Thread-1] (ContextLoader.java:124) - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsJobDetail' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'cronJobManager' while setting property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsCronTrigger' while setting property 'triggers[0]'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsCronTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsJobDetail' while setting property 'jobDetail'; nested exception is org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsCronTrigger' while setting property 'triggers[0]'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsCronTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsJobDetail' while setting property 'jobDetail'; nested exception is org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osarToEdsCronTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'osarToEdsJobDetail' while setting property 'jobDetail'; nested exception is org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForSharedInstance(AbstractBeanFactory.java:802) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveManagedList(AbstractAutowireCapableBeanFactory.java:965) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:347) at org.springframework.beans.factory.support.DefaultListableBeanFactory.isBeanTypeMatch(DefaultListableBeanFactory.java:235) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:145) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findMatchingBeans(DefaultListableBeanFactory.java:338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:707) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:641) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:255) at org.springframework.context.support.AbstractApplicationContext.refr [1/12/05 14:27:47:984 EST] 5f556b79 SystemOut U esh(AbstractApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:177) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:105) at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.servlet.engine.webapp.StrictServletInstance.doInit(ServletManager.java:802) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(StrictLifecycleServlet.java:141) at com.ibm.servlet.engine.webapp.PreInitializedServletState.init(StrictLifecycleServlet.java:254) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(StrictLifecycleServlet.java:107) at com.ibm.servlet.engine.webapp.ServletInstance.init(ServletManager.java:388) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.servlet.engine.webapp.ServletManager.addServlet(ServletManager.java:84) at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:193) at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:325) at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:1217) at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:145) at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:259) at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:168) at com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:857) at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:43) at com.ibm.ws.runtime.Server.startModule(Server.java:617) at com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:333) at com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349) at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:884) at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519) at java.lang.reflect.Method.invoke(Native Method) at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158) at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV4$1.run(ServerRunnerV4.java:56) --------- I can eliminate the above error by simply moving the quartzScheduler bean definition from the top of the xml to the last one. I'll attach the testing ear file later.

    Spring JIRA | 1 decade ago | Victor
    org.springframework.beans.factory.FactoryBeanCircularReferenceException: Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference
  3. 0

    FactoryBeans AbstractApplicationContext close

    springframework | 1 decade ago | fallofrome
    org.springframework.beans.factory.FactoryBeanCircularReferenceException: Factory bean 'securityManager' returned null object - possible cause: not fully initialized due to circular bean reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.beans.factory.FactoryBeanCircularReferenceException

      Error creating bean with name 'osarToEdsJobDetail': FactoryBean returned null object: not fully initialized due to circular bean reference

      at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForSharedInstance()
    2. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForSharedInstance(AbstractBeanFactory.java:802)
      2. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
      3. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648)
      8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288)
      9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      12. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945)
      13. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879)
      14. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveManagedList(AbstractAutowireCapableBeanFactory.java:965)
      15. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:883)
      16. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820)
      17. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648)
      18. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288)
      19. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223)
      20. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236)
      21. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      22. org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:347)
      23. org.springframework.beans.factory.support.DefaultListableBeanFactory.isBeanTypeMatch(DefaultListableBeanFactory.java:235)
      24. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:163)
      25. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:145)
      26. org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:163)
      27. org.springframework.beans.factory.support.DefaultListableBeanFactory.findMatchingBeans(DefaultListableBeanFactory.java:338)
      28. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:707)
      29. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:641)
      30. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288)
      31. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223)
      32. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236)
      33. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      34. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945)
      35. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879)
      36. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:820)
      37. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:648)
      38. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:288)
      39. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223)
      40. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236)
      41. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      42. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:255)
      42 frames