org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemConfigManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.model.dao.systemconfig.SystemConfigDAO com.manager.systemconfig.SystemConfigManager.systemConfigDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'syncSystemConfigDAO' defined in URL [jar:file:/C:/apache-tomcat-8.0.36/webapps/Universe/WEB-INF/lib/data-access-5.1.0.0.jar!/com/model/dao/systemconfig/SystemConfigDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.model.dao.systemconfig.SystemConfigDAO]: Constructor threw exception; nested exception is java.lang.NullPointerException

Stack Overflow | Harleen | 6 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Migrating Spring 3.x to Spring 4.x: Cause BeanCreationException

    Stack Overflow | 6 months ago | Harleen
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemConfigManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.model.dao.systemconfig.SystemConfigDAO com.manager.systemconfig.SystemConfigManager.systemConfigDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'syncSystemConfigDAO' defined in URL [jar:file:/C:/apache-tomcat-8.0.36/webapps/Universe/WEB-INF/lib/data-access-5.1.0.0.jar!/com/model/dao/systemconfig/SystemConfigDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.model.dao.systemconfig.SystemConfigDAO]: Constructor threw exception; nested exception is java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.dal.DAOFramework.getMorphia()
    2. com.dal
      DAOExtension.getInstance
      1. com.dal.DAOFramework.getMorphia(DAOFramework.java:113)
      2. com.dal.DAOExtension.<init>(DAOExtension.java:111)
      3. com.dal.DAOExtension.createInstance(DAOExtension.java:145)
      4. com.dal.DAOExtension.getInstance(DAOExtension.java:135)
      4 frames
    3. com.model.dao
      SystemConfigDAO.<init>
      1. com.model.dao.systemconfig.SystemConfigDAO.<init>(SystemConfigDAO.java:65)
      2. com.model.dao.systemconfig.SystemConfigDAO.<init>(SystemConfigDAO.java:56)
      2 frames
    4. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      4 frames
    5. Spring Beans
      AbstractBeanFactory.getBean
      1. org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
      2. org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
      3. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1006)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1013)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:946)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
      8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
      9. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      10. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
      12. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      13. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910)
      14. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853)
      15. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)
      16. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)
      17. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)
      18. org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
      19. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
      20. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
      21. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
      22. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
      23. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
      24. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      25. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      26. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
      27. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      27 frames
    6. Spring Context
      AbstractApplicationContext.getBean
      1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
      1 frame
    7. com.stratasync.dal
      DAOFramework.getBean
      1. com.stratasync.dal.DAOFramework.getBean(DAOFramework.java:45)
      1 frame
    8. com.beans
      ServiceAndManagerBeansCollection.getSystemConfigManager
      1. com.beans.ServiceAndManagerBeansCollection.getSystemConfigManager(ServiceAndManagerBeansCollection.java:253)
      1 frame
    9. com.distconf
      DistributedConfig.getInstance
      1. com.distconf.DistributedConfig.<init>(DistributedConfig.java:39)
      2. com.distconf.DistributedConfig.getInstance(DistributedConfig.java:51)
      2 frames
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    11. Spring Core
      MethodInvoker.invoke
      1. org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
      1 frame
    12. Spring Beans
      AbstractAutowireCapableBeanFactory.initializeBean
      1. org.springframework.beans.factory.config.MethodInvokingFactoryBean.doInvoke(MethodInvokingFactoryBean.java:162)
      2. org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:152)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485)
      4 frames