Community
Participate
Working Groups
Created attachment 165485 [details] Eclipse project demonstrating the problem Annotation Processor is throwing NullPointerException during generation of metamodel when using orm.xml mappings only (no annotations). Please see this thread for details: http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04480.html
Created attachment 165582 [details] Proposed changes
Changes have been submitted to the 2.1 stream (fix will be available from the nightly builds, http://www.eclipse.org/eclipselink/downloads/nightly.php) Reviewed: Michael O'Brien Tests: N/A, canonical model generation. Manually tested through Eclipse IDE. Existing JPA test (including extended tests) continue to pass.
After switching to version 2.1.0.v20100422-r7035, I get this error: java.lang.RuntimeException: Exception [EclipseLink-7300] (Eclipse Persistence Services - 2.1.0.v20100422-r7035): org.eclipse.persistence.exceptions.ValidationException Exception Description: Conflicting XML elements [<id>] with the same name [id] were found. The first was found in the mapping file [META-INF/orm.xml] and the second in the mapping file [META-INF/orm.xml]. Named XML elements must be unique across the persistence unit. at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:366) at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139) at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121) at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159) at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134) at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:809) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:428) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:364) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:301) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60) at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: Exception [EclipseLink-7300] (Eclipse Persistence Services - 2.1.0.v20100422-r7035): org.eclipse.persistence.exceptions.ValidationException Exception Description: Conflicting XML elements [<id>] with the same name [id] were found. The first was found in the mapping file [META-INF/orm.xml] and the second in the mapping file [META-INF/orm.xml]. Named XML elements must be unique across the persistence unit. at org.eclipse.persistence.exceptions.ValidationException.conflictingNamedXMLElements(ValidationException.java:2142) at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.shouldOverride(ORMetadata.java:595) at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.mergeORObjectLists(ORMetadata.java:378) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.XMLAttributes.merge(XMLAttributes.java:252) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.merge(ClassAccessor.java:876) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.merge(MappedSuperclassAccessor.java:504) at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings.initPersistenceUnitClasses(XMLEntityMappings.java:425) at org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnit.initXMLEntityMappings(PersistenceUnit.java:392) at org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnit.<init>(PersistenceUnit.java:85) at org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.initPersistenceUnits(PersistenceUnitReader.java:168) at org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.<init>(PersistenceUnitReader.java:63) at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:329) ... 24 more
Created attachment 165756 [details] Update patch Sorry, just realized that I had forgotten to uncomment the mapped superclass from the orm.xml when I tested with my changes. Anyway, attached is an update to the correction and has been submitted. Reviewed: Michael O'Brien
Reverted changes from last patch. More complete solution to follow ...
Created attachment 166244 [details] Proposed changes
Changes have been submitted Reviewed: Tom Ware Tests: N/A, canonical model generation. Manually tested through Eclipse IDE. Existing JPA test (including extended tests) continue to pass.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink