Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NullPointerException using mapped-superclass
NullPointerException using mapped-superclass [message #540218] Tue, 15 June 2010 12:32 Go to next message
A. D is currently offline A. DFriend
Messages: 4
Registered: June 2010
Junior Member
I've tried to configure o/r mapping within orm.xml, but always get a NullPointerException for a mapped superclass. (EclipseLink 2.0.2)

...
	<mapped-superclass class="com.xyz.framework.server.masterdata.MasterData">
		<attributes>
			<basic name="creationId">
				<column name="erf_id" />
			</basic>
			<basic name="creationDate">
				<column name="erf_dat" />
				<temporal>DATE</temporal>
			</basic>
			<basic name="modificationId">
				<column name="aend_id" />
			</basic>
			<basic name="modificationDate">
				<column name="aend_dat" />
				<temporal>DATE</temporal>
			</basic>
			<basic name="updateCounter">
				<column name="updateCounter" />
			</basic>
		</attributes>
	</mapped-superclass>
...


Exception Description: Predeployment of PersistenceUnit [default-persistence-context] failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:210)
        ... 33 more
Caused by: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.getProject(MetadataDescriptor.java:944)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.<init>(ClassAccessor.java:183)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.<init>(MappedSuperclassAccessor.java:161)
        at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.reloadMappedSuperclass(ORMetadata.java:460)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.addPotentialMappedSuperclass(EntityAccessor.java:219)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:312)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:610)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:593)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1296)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:460)
        at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:390)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:945)
        ... 32 more



Kind regards,

André
Re: NullPointerException using mapped-superclass [message #540886 is a reply to message #540218] Thu, 17 June 2010 14:35 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to be a bug, what version are you using?

Please log this bug and vote for it. The bug seems to be in,

>> EntityAccessor.addPotentialMappedSuperclass
>> getProject().addMetamodelMappedSuperclass(metadataClass, reloadMappedSuperclass(accessor, new MetadataDescriptor(metadataClass)));

A workaround may be to use annotations instead of xml, or in addition.



James : Wiki : Book : Blog : Twitter
Previous Topic:@PreUpdate not called with AspectJ
Next Topic:Criteria API: How-to cast an entity attribute?
Goto Forum:
  


Current Time: Sun Nov 23 03:43:00 GMT 2014

Powered by FUDForum. Page generated in 0.02270 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software