Community
Participate
Working Groups
Build Identifier: I20100608-0911 I migrated from EL 2.0.0.v20091127-r5931 to 2.3.0.v20110604-r9504 but the deployment of my PU fails with a NPE. I've got an entity class which implements a couple of interfaces AND extends a NON-entity class. During the deploy of the persistence unit the method EntityAccessor.discoverMappedSuperclassesAndInheritanceParents is being called. The while-loop in line 241 operates upon an object named "parentClass" without making sure it's not null. The first while-loop-iteration works fine as the object is not null. But in line 286 the parentClass-variable is assigned a new value (which is null) and this causes the next iteration to fail with an NPE. Reproducible: Always
Can you post the stack trace?
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
This is a regression (from bug 253083)
Well I thought it was a regression, but I am having a hard time to reproduce this exception. Beginning to wonder if it has already been fixed. Could you try to reproduce on the latest nigthly for 2.3.1? http://www.eclipse.org/eclipselink/downloads/nightly.php
I've been unable to reproduce this issue. If the error is still present using the latest 2.3.1 nightly please re-open the bug with your test model to reproduce.
The problem is not resolved in release 2.3.2 I have NPE in eclipselink 2.3.2 release, because the parentClass is null. This is the statement "243:while (! parentClass.isObject()) {" To reproduce, deploy a JPA Entity in this class hierarchy: @Entity public class ExampleEntity extends BaseEntityImpl { ... } @MappedSuperclass public class BaseEntityImpl extends Base{ ... } public class Base { ... } Workaround is to extend the Base class explicit from Object, like public class Base extends Object { Please fix like "243:while (parentClass!=null && !parentClass.isObject()) {" [exec] java.lang.NullPointerException [exec] at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:243) [exec] at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:526) [exec] at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1608) [exec] at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:531) [exec] at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526) [exec] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1337) [exec] at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:208) [exec] at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393) [exec] at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386) [exec] at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158) [exec] at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39) [exec] at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349) [exec] at weblogic.deployment.EarPersistenceUnitRegistry.initialize(EarPersistenceUnitRegistry.java:72)
I'm experiencing the same problem. I'm using version 2.4.1. Caused by: java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:244) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:527) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1649) at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:531) at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:550) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1469)
Created attachment 226123 [details] Submitted Changes I've submitted this patch, however, note I was unable to reproduce the exception. Since we make a similar null check in other places, I decided to add it here as well. Note, however, the fact that the superclass is null before reaching Object 'could' lend itself to a configuration issue. The only time I could see a superclass being null is when we were unable to load the class. (We load and visit classes using ASM to be internal MetadataClass for processing)
*** Bug 401785 has been marked as a duplicate of this bug. ***
I can confirm that this is still an issue in 2.4.1.v20121003-ad44345
The fix will be available in 2.4.2 + In the mean time, if plausible, you can grab a nightly build from here: http://www.eclipse.org/eclipselink/downloads/nightly.php
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink