-
Bug
-
Resolution: Done
-
Major
-
1.0.0.Alpha5
The example in Reference Guide - 2.3. Testing JPA does not work due to ShrinkWrap issue 266.
The example results in an EJBException:
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5194)
[...]
Caused by: java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName [...]
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.init(EntityManagerWrapper.java:132)
[...]
There is a work around though:
Add the persistence unit manually in its right location:
war.addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml");