Problem adding JPA facet to maven project
by jbdevstudio-users@lists.jboss.org
IMPORTANT NOTE: I can only access the internet with IE. Not with eclipse. Not with any git client. If you answer, PLEASE PLEASE PLEASE do not .suggest anything that involves the eclipse marketplace or any update or install sites. (can you tell I've been down that path before. :-) ). Thanks in advance
If this is not a JBDS issue, please point me in the right direction.
I just downloaded JBDS 7.1.0 GA so I would have the latest version.
I imported a simple maven project with only hibernate core as a dependency. Once it's imported I want to add JPA 2.0 facet.
Attempt #1:
I went into Project Facets and select Java facet 1.6 (it was 1.4 by default) and JPA 2.0. I clicked on Targeted Runtimes tab and select jboss-eap 6.1 runtime. I clicked on "further configuration available" link and it took me to the JPA configuration page where I selected Hibernate 2.0 for platform and under JPA Implementation selected Library provided by targeted runtime. Failed with NPE, details from .log below:
!ENTRY org.eclipse.wst.common.project.facet.core 4 0 2014-01-12 10:15:19.598
!MESSAGE Failed while installing JPA 2.0.
!STACK 0
java.lang.NullPointerException
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.defaultResourceLocation(JpaFacetInstallDelegate.java:143)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.createPersistenceXml(JpaFacetInstallDelegate.java:113)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.createProjectXml(JpaFacetInstallDelegate.java:103)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.execute_(JpaFacetInstallDelegate.java:62)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetActionDelegate.execute(JpaFacetActionDelegate.java:35)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1477)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:441)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$5.run(FacetedProject.java:1099)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges(FacetedProject.java:1109)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.commitChanges(FacetedProjectWorkingCopy.java:2020)
at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$4.run(FacetsPropertyPage.java:232)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$5.run(FacetsPropertyPage.java:246)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Attempt 2:
Used Hibernate 4.3.0.Final as maven dependency which includes JPA 2.1 implementation. I told JPA Facet to use maven dependencies which are in class path. Got the same result.
!ENTRY org.eclipse.wst.common.project.facet.core 4 0 2014-01-12 10:29:41.860
!MESSAGE Failed while installing JPA 2.1.
!STACK 0
java.lang.NullPointerException
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.defaultResourceLocation(JpaFacetInstallDelegate.java:143)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.createPersistenceXml(JpaFacetInstallDelegate.java:113)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.createProjectXml(JpaFacetInstallDelegate.java:103)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDelegate.execute_(JpaFacetInstallDelegate.java:62)
at org.eclipse.jpt.jpa.core.internal.facet.JpaFacetActionDelegate.execute(JpaFacetActionDelegate.java:35)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1477)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:441)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$5.run(FacetedProject.java:1099)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges(FacetedProject.java:1109)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.commitChanges(FacetedProjectWorkingCopy.java:2020)
at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$4.run(FacetsPropertyPage.java:232)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$5.run(FacetsPropertyPage.java:246)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Posted by forums
Original post: https://community.jboss.org/message/852535#852535