org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Service': Cannot resolve reference to bean 'Services' while setting bean property 'serviceBeans' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Services': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.abc.services.dao.Dao com.abc.services.Services.dao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAO': Invocation of init method failed; nested exception is com.abc.services.exceptions.Exception: An exception occurred.

Stack Overflow | drjay | 2 months ago
  1. 0

    Prevent java concurrency issue during jboss deployment @PostConstruct

    Stack Overflow | 2 months ago | drjay
    org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Service': Cannot resolve reference to bean 'Services' while setting bean property 'serviceBeans' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Services': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.abc.services.dao.Dao com.abc.services.Services.dao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAO': Invocation of init method failed; nested exception is com.abc.services.exceptions.Exception: An exception occurred.

    Root Cause Analysis

    1. com.abc.services.exceptions.Exception

      An exception occurred.

      at com.abc.services.dao.Dao.getDataMapping()
    2. com.abc.services
      Dao.getDataMapping
      1. com.abc.services.dao.Dao.getDataMapping(Dao.java:471)[classes:]
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[rt.jar:1.7.0_75]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[rt.jar:1.7.0_75]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[rt.jar:1.7.0_75]
      4. java.lang.reflect.Method.invoke(Method.java:606)[rt.jar:1.7.0_75]
      4 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      2. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      3. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      12. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:876)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      13. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:818)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      14. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:735)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      15. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      16. org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      17. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      18. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      19. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      20. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      21. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      22. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      23. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      24. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      25. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      26. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      27. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      28. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      29. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      30. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      31. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      32. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      33. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      34. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      35. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      36. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      37. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      37 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)[spring-context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)[spring-context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
      2 frames
    6. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      3 frames
    7. Glassfish Core
      StandardContext.start
      1. org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339)[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
      2. org.apache.catalina.core.StandardContext.start(StandardContext.java:3777)[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
      2 frames
    8. JBoss Web
      WebDeploymentService$1.run
      1. org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)[jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
      2. org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)[jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
      3. org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)[jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
      3 frames
    9. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[rt.jar:1.7.0_75]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:262)[rt.jar:1.7.0_75]
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.0_75]
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.0_75]
      5. java.lang.Thread.run(Thread.java:745)[rt.jar:1.7.0_75]
      5 frames
    10. JBoss Threads
      JBossThread.run
      1. org.jboss.threads.JBossThread.run(JBossThread.java:122)
      1 frame