-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Upgrading to 4.x - NullPointerException Configuration
PostPosted: Wed Feb 29, 2012 3:34 pm 
Regular
Regular

Joined: Tue Feb 17, 2009 3:36 pm
Posts: 78
During the course of upgrading to the Hibernate 4.1.0 from the 3.6.8, I run into a quite few problems. After having resolved a few problems, I can't figure out how to solve this error occurred during the system start up.
Code:
...
Caused by: java.lang.NullPointerException
        at org.hibernate.cfg.Configuration.processFkSecondPassInOrder(Configuration.java:1415)
        at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1355)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1724)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775)
        at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:184)
        at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:314)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
        ... 55 more


It seems to relate with a compound key. I don't have a clue of starting solve this problem.

Any thought?


Top
 Profile  
 
 Post subject: Re: Upgrading to 4.x - NullPointerException Configuration
PostPosted: Fri Mar 02, 2012 1:55 am 
Regular
Regular

Joined: Tue Feb 17, 2009 3:36 pm
Posts: 78
I shall add that this error occurs during Tomcat starting up. And it is from sessionFactory in a Spring configuration file:
Code:
   <bean id="sessionFactory"
      class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
      <property name="dataSource" ref="dataSource" />
      <property name="mappingResources">
         <list>
            <value>abc.hbm.xml</value>
         </list>
      </property>
      <property name="annotatedClasses">
         <list>
            <value>com.abc.myapp.user.domain.User</value>
            ...
         </list>
      </property>
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
            <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
            <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.DefaultComponentSafeNamingStrategy
            </prop>
         </props>
      </property>
   </bean>



Top
 Profile  
 
 Post subject: Re: Upgrading to 4.x - NullPointerException Configuration
PostPosted: Sun Mar 04, 2012 11:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 11, 2009 2:26 am
Posts: 29
would you please provide your mappings?


Top
 Profile  
 
 Post subject: Re: Upgrading to 4.x - NullPointerException Configuration
PostPosted: Sun Mar 04, 2012 3:13 pm 
Regular
Regular

Joined: Tue Feb 17, 2009 3:36 pm
Posts: 78
Thanks Stliu for your reply. I used the divide and conquest approach to find the cause. It is the subclass/subclass annotation differences between the 3.x annotation package and the 4 version. This problem is hopefully solved right now at this moment I can bring up the application. I still need to do more running time tests though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.