Community
Participate
Working Groups
1. Create a new Generic 2.0 JPA project with an orm.xml file in the META-INF folder. 2. Create a new subfolder in META-INF 3. move the orm.xml file to the subfolder, you get an NPE: java.lang.NullPointerException at org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXml.unregisterRootStructureNode(GenericOrmXml.java:213) at org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXml.synchronizeWithResourceModel(GenericOrmXml.java:96) at org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractMappingFileRef.syncMappingFile(AbstractMappingFileRef.java:116) at org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractMappingFileRef.synchronizeWithResourceModel(AbstractMappingFileRef.java:72) at org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit.syncImpliedMappingFileRef(AbstractPersistenceUnit.java:652) at org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit.synchronizeWithResourceModel(AbstractPersistenceUnit.java:222) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistence.syncPersistenceUnits(GenericPersistence.java:143) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistence.synchronizeWithResourceModel(GenericPersistence.java:63) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.synchronizeWithResourceModel(GenericPersistenceXml.java:104) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.syncPersistenceXml(GenericRootContextNode.java:90) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.synchronizeWithResourceModel(GenericRootContextNode.java:66) at org.eclipse.jpt.jpa.core.internal.AbstractJpaProject.synchronizeContextModel(AbstractJpaProject.java:1818) at org.eclipse.jpt.jpa.core.GenericJpaProjectManager$1.execute(GenericJpaProjectManager.java:432)
This bug is fixed with the proposed patch of bug 341415. The changes made in AbstractMappingFileRef change the way a mapping file synchronizes with resource model, which leads to the nonexistent implied mapping file (becomes a specified mapping file after being moved to a subfolder) being properly handled.
Verified in Build I-3.4.0-20110731180834 Verified you can move orm.xml mapping file without error. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0.1