Community
Participate
Working Groups
I have a web project that has the JPA facet too. By default the persistence.xml is created in the src/META-INF folder of the project. I am using the latest eclipse 372 I have the free OSGI tools that I am using to add the OSGi facet to the project. As part of the facetInstallDelegate, it tries to move the persistence.xml to the same location as the MANIFEST.MF which is in this case inside the webContent/META-INF folder. The move of the file succeeds, but right after I get this NPE java.lang.NullPointerException at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.registerRootStructureNode(GenericPersistenceXml.java:219) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.update(GenericPersistenceXml.java:115) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.syncPersistenceXml(GenericRootContextNode.java:123) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.updatePersistenceXml(GenericRootContextNode.java:157) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.update(GenericRootContextNode.java:73) at org.eclipse.jpt.jpa.core.internal.AbstractJpaProject.update(AbstractJpaProject.java:1898) at org.eclipse.jpt.jpa.core.GenericJpaProjectManager$2.execute(GenericJpaProjectManager.java:452) at org.eclipse.jpt.common.core.internal.utility.JobSynchronizer$SynchronizationJob.run(JobSynchronizer.java:160) at org.eclipse.jpt.common.core.internal.utility.CallbackJobSynchronizer$CallbackSynchronizationJob.run(CallbackJobSynchronizer.java:137) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Is there certain expectations that this file has to be in the src folder ?
I do not see this problem when using Eclipse 362.
Sounds like a possible regression. I'll investigate.
I'm unable to get as far as you are getting. The addition of the OSGi Bundle Facet fails for me with the following exception. Not sure if our configuration is different, but I just have a default Dynamic Web Project with JPA Facet. org.eclipse.core.internal.resources.ResourceException: Resource '/WebProj/META-INF' does not exist. at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:320) at org.eclipse.core.internal.resources.Resource.checkMoveRequirements(Resource.java:391) at org.eclipse.core.internal.resources.Resource.assertMoveRequirements(Resource.java:185) at org.eclipse.core.internal.resources.Resource.move(Resource.java:1579) at org.eclipse.core.internal.resources.Resource.move(Resource.java:1559) at org.eclipse.libra.facet.OSGiBundleFacetInstallDelegate.moveMetaInfToRoot(OSGiBundleFacetInstallDelegate.java:357) at org.eclipse.libra.facet.OSGiBundleFacetInstallDelegate.doExecute(OSGiBundleFacetInstallDelegate.java:87) at org.eclipse.libra.facet.OSGiBundleFacetInstallDelegate.execute(OSGiBundleFacetInstallDelegate.java:76) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1477) It appears to be looking for a meta-inf folder at the root, which does not exist. Not sure if they expect it to be there, are were unable to create it. What version of libra are you using? I am using 1.1.x. Adding Kaloyan. Perhaps this is a Libra issue.
As a side note, adding the OSGi bundle facet to a simple JPA project works fine. Resources are moved as expected and things work fine afterwards.
Reassigning to Libra since this looks more like a Libra issue from my testing.
I was able to see a very similar issue as the one reported here, Web+JPA project, then converted to OSGi, result is NPE in GenericPersistenceXml.java:260 java.lang.NullPointerException at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.unregisterRootStructureNode(GenericPersistenceXml.java:260) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.syncPersistence(GenericPersistenceXml.java:124) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.updatePersistence(GenericPersistenceXml.java:97) at org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.update(GenericPersistenceXml.java:93) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.syncPersistenceXml(GenericRootContextNode.java:127) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.updatePersistenceXml(GenericRootContextNode.java:161) at org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.update(GenericRootContextNode.java:77) at org.eclipse.jpt.jpa.core.internal.AbstractJpaProject.update(AbstractJpaProject.java:2036) at org.eclipse.jpt.jpa.core.internal.AbstractJpaProject$UpdateJobCommand.execute(AbstractJpaProject.java:2023) at org.eclipse.jpt.common.core.internal.utility.command.RepeatingJobCommandWrapper.executeCommand(RepeatingJobCommandWrapper.java:207) at org.eclipse.jpt.common.core.internal.utility.command.NotifyingRepeatingJobCommandWrapper.executeCommand(NotifyingRepeatingJobCommandWrapper.java:69) at org.eclipse.jpt.common.core.internal.utility.command.RepeatingJobCommandWrapper.execute_(RepeatingJobCommandWrapper.java:192) at org.eclipse.jpt.common.core.internal.utility.command.RepeatingJobCommandWrapper$StartJobCommand.execute(RepeatingJobCommandWrapper.java:172) at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.execute_(InternalJpaProjectManager.java:1120) at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager$ClientJobCommandWrapper.execute(InternalJpaProjectManager.java:1100) at org.eclipse.jpt.common.core.internal.utility.command.JobCommandJob.run(JobCommandJob.java:42) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)