org.springframework.beans.factory.BeanCreationException: Error creating Hibernate SessionFactory FactoryBean; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException

Hibernate JIRA | Matt Sgarlata | 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

    If an invalid proxy interface is specified for an object managed by hibernate, an NPE is raised. A more descriptive error would be nice :) Here's an example (invalid) mapping. The interface specified exists, but is in a different package: <hibernate-mapping > <class name="com.spider.scoreboard.hdao.impl.PerformanceChartHDao" table="performancecharts" proxy="com.spider.scoreboard.hdao.IPerformanceChart" dynamic-update="false" dynamic-insert="false" select-before-update="false" optimistic-lock="version" > <id name="id" column="performancechartid" type="java.lang.Integer" > <generator class="assigned"> <!-- To add non XDoclet generator parameters, create a file named hibernate-generator-params-PerformanceChartHDao.xml containing the additional parameters and place it in your merge dir. --> </generator> </id> <property name="name" type="java.lang.String" update="true" insert="true" access="property" column="performancechartname" /> <property name="backgroundImageId" type="java.lang.Integer" update="true" insert="true" access="property" column="backgroundimageid" /> <property name="zoomScale" type="java.lang.Double" update="true" insert="true" access="property" column="zoomscale" /> <set name="edges" lazy="true" inverse="true" cascade="all" sort="unsorted" > <key column="performancechartid" > </key> <one-to-many class="com.spider.scoreboard.hdao.impl.PerformanceChartEdgeHDao" /> </set> <set name="nodes" lazy="true" inverse="true" cascade="all" sort="unsorted" > <key column="performancechartid" > </key> <one-to-many class="com.spider.scoreboard.hdao.impl.PerformanceChartNodeHDao" /> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-PerformanceChartHDao.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> Here is the stack trace: ERROR (ScoreboardContextLoaderServlet:startupOrRestart) - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating Hibernate SessionFactory FactoryBean; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:103) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:217) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:401) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:206) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:678) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:613) at com.spider.scoreboard.database.DatabaseBeanFactoryPostProcessor.createLocalSessionFactoryBean(DatabaseBeanFactoryPostProcessor.java:150) at com.spider.scoreboard.database.DatabaseBeanFactoryPostProcessor.postProcessBeanFactory(DatabaseBeanFactoryPostProcessor.java:90) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:375) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:301) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131) at com.spider.scoreboard.framework.springx.ScoreboardApplicationContext.refresh(ScoreboardApplicationContext.java:73) at com.spider.scoreboard.framework.springx.ScoreboardContextLoaderServlet.loadContext(ScoreboardContextLoaderServlet.java:319) at com.spider.scoreboard.framework.springx.ScoreboardContextLoaderServlet.startupOrRestart(ScoreboardContextLoaderServlet.java:118) at com.spider.scoreboard.framework.springx.ScoreboardContextLoaderServlet.init(ScoreboardContextLoaderServlet.java:83) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:888) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:776) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3363) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3586) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141) at org.apache.catalina.core.StandardHost.start(StandardHost.java:707) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143) at org.apache.catalina.startup.Catalina.start(Catalina.java:463) at org.apache.catalina.startup.Catalina.execute(Catalina.java:350) at org.apache.catalina.startup.Catalina.process(Catalina.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)

    Hibernate JIRA | 1 decade ago | Matt Sgarlata
    org.springframework.beans.factory.BeanCreationException: Error creating Hibernate SessionFactory FactoryBean; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException

    Root Cause Analysis

    1. org.springframework.beans.factory.BeanCreationException

      Error creating Hibernate SessionFactory FactoryBean; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException

      at org.hibernate.tuple.PojoTuplizer.buildProxyFactory()
    2. Hibernate
      SingleTableEntityPersister.<init>
      1. org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:103)
      2. org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)
      3. org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
      4. org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47)
      5. org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:217)
      6. org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:401)
      7. org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
      7 frames
    3. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
      2. org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:206)
      2 frames
    4. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
      1 frame
    5. Hibernate
      LocalSessionFactoryBean.afterPropertiesSet
      1. org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:678)
      2. org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:613)
      2 frames
    6. com.spider.scoreboard
      DatabaseBeanFactoryPostProcessor.postProcessBeanFactory
      1. com.spider.scoreboard.database.DatabaseBeanFactoryPostProcessor.createLocalSessionFactoryBean(DatabaseBeanFactoryPostProcessor.java:150)
      2. com.spider.scoreboard.database.DatabaseBeanFactoryPostProcessor.postProcessBeanFactory(DatabaseBeanFactoryPostProcessor.java:90)
      2 frames
    7. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:375)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:301)
      2 frames
    8. Spring
      AbstractRefreshableWebApplicationContext.refresh
      1. org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131)
      1 frame
    9. com.spider.scoreboard
      ScoreboardContextLoaderServlet.init
      1. com.spider.scoreboard.framework.springx.ScoreboardApplicationContext.refresh(ScoreboardApplicationContext.java:73)
      2. com.spider.scoreboard.framework.springx.ScoreboardContextLoaderServlet.loadContext(ScoreboardContextLoaderServlet.java:319)
      3. com.spider.scoreboard.framework.springx.ScoreboardContextLoaderServlet.startupOrRestart(ScoreboardContextLoaderServlet.java:118)
      4. com.spider.scoreboard.framework.springx.ScoreboardContextLoaderServlet.init(ScoreboardContextLoaderServlet.java:83)
      4 frames
    10. JavaServlet
      GenericServlet.init
      1. javax.servlet.GenericServlet.init(GenericServlet.java:258)
      1 frame
    11. Glassfish Core
      Catalina.process
      1. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:888)
      2. org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:776)
      3. org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3363)
      4. org.apache.catalina.core.StandardContext.start(StandardContext.java:3586)
      5. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
      6. org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
      7. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
      8. org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
      9. org.apache.catalina.core.StandardService.start(StandardService.java:450)
      10. org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
      11. org.apache.catalina.startup.Catalina.start(Catalina.java:463)
      12. org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
      13. org.apache.catalina.startup.Catalina.process(Catalina.java:129)
      13 frames
    12. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    13. Glassfish Core
      Bootstrap.main
      1. org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)
      1 frame