2 Replies Latest reply on Oct 12, 2008 10:48 PM by hipa

    Separate JARs for Entity and Session beans

    hipa

      Is it possible to separate my entityies and session beans? If I don't add persistence.xml to the JAR with entities hibernate don't see them (no tables will be created). If I add persistence.xml to both session beans JAR and entities JAR hibernate generate IllegalArgumentException: Unknown entity on each EntityManager call.

        • 1. Re: Separate JARs for Entity and Session beans
          jaikiran

           

          "hipa" wrote:
          Is it possible to separate my entityies and session beans?


          Yes, its possible.

          "hipa" wrote:

          If I don't add persistence.xml to the JAR with entities hibernate don't see them (no tables will be created). If I add persistence.xml to both session beans JAR and entities JAR hibernate generate IllegalArgumentException: Unknown entity on each EntityManager call.


          Add the persistence.xml in the META-INF folder of your ejb jar and use the jar-file element in the persistence.xml to point to the entities jar. If you run into any exceptions, please post the details which includes the JBoss, Java version and the entire exception stacktrace.


          • 2. Re: Separate JARs for Entity and Session beans
            hipa

            Thank you for the tip. It works.