I have an generated class file I'd like to persist (so I can't add an annotation to it) so I tried to use the ORM.xml aproach to tell eclipse link that ist should use the fields in this class also.
For simplicity I removed all code from the generated code (of course it normaly contains field, but gave the same error), it just looks like this;
package de.rki.ibis200907;
public class LabResultType {
}
and a derived (annotated) class:
@Table(name = "mvare_labresulttype_200907")
@Entity
public class PersistentLabResultType extends LabResultType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
public void setID(long id) {
this.id = id;
}
public long getID() {
return id;
}
}
Finally the problem is I get the following error on schmea generation:
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [ibis200907] failed.
Internal Exception: java.lang.NullPointerException
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:221)
... 46 more
Caused by: java.lang.NullPointerException
at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.getProject(MetadataDescriptor.java:1086)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.<init>(ClassAccessor.java:253)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.<init>(MappedSuperclassAccessor.java:233)
at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.reloadMappedSuperclass(ORMetadata.java:618)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addPotentialMappedSuperclass(ClassAccessor.java:526)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:275)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:514)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1590)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:517)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1320)
... 45 more
If I add an @MappedSuperclass and omit the orm.xml everything works fine.
Does anyone has an hint what I'm doing wrong?
(I had to remove all transport protocoll specifierer from the URLs of the Schema uris because of the: You cannot use links until you have posted more than 5 messages. error)
so you think it should normaly work this way? Do you know if it is okay that I link this topic in the bug description or should i copy everything over?