java.lang.NullPointerException

Spring JIRA | Joshua Spiewak | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    These beans were working with 1.1.2, but after updating to 1.1.3 this morning, I get a NPE. I noticed that AbstractAutowireCapableBeanFactory and AbstractBeanFactory underwent some several changes between versions. Let me know if I can provide more information to help track down the issue, or whether I am abusing Spring somehow. <bean name="mBeanServers" class="javax.management.MBeanServerFactory" factory-method="findMBeanServer"> <constructor-arg index="0"><null/></constructor-arg> </bean> <bean name="mBeanServer" factory-bean="mBeanServers" factory-method="get"> <constructor-arg index="0"><value>0</value></constructor-arg> </bean> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mBeanServer' defined in URL [file:/D:/opt/jonas-3.3.9/webapps/jonas/edith/WEB-INF/classes/beanOverrides.xml]: Instantiation of bean failed; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:381) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:264) 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.resolveConstructorArguments(AbstractAutowireCapableBeanFactory.java:526) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:358) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:264) 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:261) at org.springframework.context.support.AbstractApplicationContext.refresh(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:256)

    Spring JIRA | 1 decade ago | Joshua Spiewak
    java.lang.NullPointerException
  2. 0

    These beans were working with 1.1.2, but after updating to 1.1.3 this morning, I get a NPE. I noticed that AbstractAutowireCapableBeanFactory and AbstractBeanFactory underwent some several changes between versions. Let me know if I can provide more information to help track down the issue, or whether I am abusing Spring somehow. <bean name="mBeanServers" class="javax.management.MBeanServerFactory" factory-method="findMBeanServer"> <constructor-arg index="0"><null/></constructor-arg> </bean> <bean name="mBeanServer" factory-bean="mBeanServers" factory-method="get"> <constructor-arg index="0"><value>0</value></constructor-arg> </bean> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mBeanServer' defined in URL [file:/D:/opt/jonas-3.3.9/webapps/jonas/edith/WEB-INF/classes/beanOverrides.xml]: Instantiation of bean failed; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:381) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:264) 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.resolveConstructorArguments(AbstractAutowireCapableBeanFactory.java:526) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:358) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:264) 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:261) at org.springframework.context.support.AbstractApplicationContext.refresh(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:256)

    Spring JIRA | 1 decade ago | Joshua Spiewak
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod()
    2. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:381)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:264)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:945)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:879)
      8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveConstructorArguments(AbstractAutowireCapableBeanFactory.java:526)
      9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:358)
      10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:264)
      11. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:223)
      12. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:236)
      13. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      14. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:261)
      14 frames
    3. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
      1 frame
    4. Spring
      ContextLoaderServlet.init
      1. org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131)
      2. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:177)
      3. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:105)
      4. org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)
      4 frames
    5. JavaServlet
      GenericServlet.init
      1. javax.servlet.GenericServlet.init(GenericServlet.java:256)
      1 frame