5 Replies Latest reply on Feb 3, 2011 2:36 PM by Marek Novotny

    How to package an entity jar inside a WAR?

    Naresh Bhatia Newbie
      I have a Seam application packaged as a WAR. Inside the WEB-INF/lib directory, I have a jar file that contains my persistent entities. What is the correct way to package the WAR so that my entities are picked up correctly. I have tried these two ways:

      1) Put persistence.xml inside the jar containing the entities (under META-INF). This absolutely doesn't work.

      2) Put persistence.xml under WEB-INF/classes/META-INF with a reference to the jar file containing the entities. This setup is at least recognizing the persistence.xml file, but it is not able to find the jar file (I get the message "Exploded jar does not exists"). I have tried various combinations such as:

          <jar-file>myentities.jar</jar-file>
          <jar-file>../myentities.jar</jar-file>
          <jar-file>/WEB-INF/lib/myentities.jar</jar-file>

      Can someone please help me understand the correct way to do this?

      Thanks.
      Naresh