Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-445

Error in docs: Testing JPA and SHRINKWRAP-266

    XMLWordPrintable

Details

    • Hide

      Run example code.

      Show
      Run example code.

    Description

      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");
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            agallardo_jira Alberto Gallardo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: