NPE in org.hibernate.jpa.internal.util.PersistenceUtilHelper.isInitialized(PersistentAttributeInterceptable)

Description

Depending upon how bytecode enhancement is set up, PersistentAttributeInterceptable.$$_hibernate_getInterceptor() may return null.
I noticed this happens with this configuration of the maven enhancer:

<configuration> <enableAssociationManagement>true</enableAssociationManagement> <enableDirtyTracking>false</enableDirtyTracking> <enableLazyInitialization>true</enableLazyInitialization> <enableExtendedEnhancement>false</enableExtendedEnhancement> </configuration>

The problem is at https://github.com/hibernate/hibernate-orm/blob/5.2.5/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java#L97 - the fix is to just add a null check. Here's a pull request:
https://github.com/hibernate/hibernate-orm/pull/1660

Web links

Activity

Show:

Former user March 15, 2017 at 12:21 AM

Fixed in 5.1 branch as well.

Vlad Mihalcea December 8, 2016 at 8:55 AM

You might want to backport this one too.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created November 30, 2016 at 7:15 PM
Updated March 15, 2017 at 12:34 AM
Resolved March 15, 2017 at 12:21 AM