NullPointerException in getPersistenceUnitUtil().getIdentifier() on detached enhanced entity

Description

The exception occurs on entityManagerFactory.getPersistenceUnitUtil().getIdentifier(entity), passing a detached and enhanced entity as argument. When I disable hibernate-enhance-maven-plugin or back to 5.2.2, the exception don't happens.

Stack Trace:

Exception in thread "pool-1-thread-1" java.lang.NullPointerException
at org.hibernate.jpa.internal.PersistenceUnitUtilImpl.getIdentifier(PersistenceUnitUtilImpl.java:74)
at mypackage.ServerInitListener.serverInit(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

I created a test case in this fork: https://github.com/edallagnol/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5/

Edit: I can't test in 5.2.5, because of this exception: https://hibernate.atlassian.net/browse/HHH-11322

Activity

Show:

Former userMay 10, 2017 at 10:15 PM

Fixed in 5.1 as well.

Former userFebruary 22, 2017 at 3:50 AM

Correction: this will affect 5.0/5.1 if https://hibernate.atlassian.net/browse/HHH-11274#icft=HHH-11274 is backported.

Former userFebruary 22, 2017 at 3:46 AM

This does not affect 5.0/5.1.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created January 26, 2017 at 12:29 PM
Updated May 20, 2017 at 1:12 AM
Resolved May 10, 2017 at 10:15 PM

Flag notifications