Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338413 - NPE moving orm.xml to a subfolder in META-INF
Summary: NPE moving orm.xml to a subfolder in META-INF
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Nan Li CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-28 09:10 EST by Karen Butzke CLA
Modified: 2011-08-04 12:56 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2011-02-28 09:10:02 EST
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)
Comment 1 Nan Li CLA 2011-06-07 12:41:25 EDT
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.
Comment 2 Jolene Moffitt CLA 2011-08-04 12:56:17 EDT
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