-->
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.  [ 3 posts ] 
Author Message
 Post subject: NullPointerException in ModelBinder during bootstrapping
PostPosted: Fri Feb 17, 2017 1:03 pm 
Newbie

Joined: Fri Feb 17, 2017 12:53 pm
Posts: 2
We're upgrading from Hibernate 4.3.11 to Hibernate 5.2.7 and are getting a NullPointerException in ModelBinder when it tries to access a PrimaryKey. It's null.

We have a mix of HBM and Annotation entities. It happens when an entity is mapped via XML and references an entity that is mapped via annotations - many to one. We're using the legacy bootstrapping process via spring's LocalSessionFactoryBuilder (version 5).

I'd appreciate any suggestions what could be wrong, how to debug further, or things to try.

Here's the exception:

Code:
Caused by: java.lang.NullPointerException
        at org.hibernate.boot.model.source.internal.hbm.ModelBinder$ManyToOneColumnBinder.doSecondPass(ModelBinder.java:4140) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1621) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1576) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:278) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726) ~[hibernate-core-5.2.7.Final.jar:5.2.7.Final]
        at com.i2rd.hibernate.util.RebuildableSessionFactoryBean.createSessionFactory(RebuildableSessionFactoryBean.java:242) ~[net.proteusframework-core.jar:?]
        at com.i2rd.hibernate.util.RebuildableSessionFactoryBean.rebuildSessionFactory(RebuildableSessionFactoryBean.java:204) ~[net.proteusframework-core.jar:?]
        at com.i2rd.hibernate.util.RebuildableSessionFactoryBean.getObject(RebuildableSessionFactoryBean.java:182) ~[net.proteusframework-core.jar:?]
        at com.i2rd.hibernate.util.RebuildableSessionFactoryBean.getObject(RebuildableSessionFactoryBean.java:54) ~[net.proteusframework-core.jar:?]
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]


Top
 Profile  
 
 Post subject: Re: NullPointerException in ModelBinder during bootstrapping
PostPosted: Fri Feb 17, 2017 4:01 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
Hard to figure out why it shouldn't work. If you can replicate with a test case, then you should open a Jira issue.


Top
 Profile  
 
 Post subject: Re: NullPointerException in ModelBinder during bootstrapping
PostPosted: Fri Feb 17, 2017 6:31 pm 
Newbie

Joined: Fri Feb 17, 2017 12:53 pm
Posts: 2
Thanks. I opened this issue: https://hibernate.atlassian.net/browse/HHH-11502


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.