2 Replies Latest reply on Sep 25, 2007 7:44 PM by Andrew Rubinger

    Entities in seperate jar files

    Rajeev K Newbie

      I am trying to do the following,

      Jar 1 - contains the stateless session beans+some entity beans+persistence.xml file+manifest.mf(this has the reference to the jar2)

      jar 2 - few remaining entity beans.

      The session beans from the jar1 use the entity beans in the jar2.

      Is this possible? How should I deploy? I mean should both jar1 and jar2 go into Jboss deploy directory?

      Thanks in advance

        • 1. Re: Entities in seperate jar files
          wayne baylor Apprentice

          you can deploy each separately or package them both in an EAR and deploy the EAR.

          • 2. Re: Entities in seperate jar files
            Andrew Rubinger Master

            If there's any relationship between the entities in Jar1 and Jar2 (associations, mapped superclasses, etc), you'll have to reference the classes in Jar1's persistence.xml file under the "class" node:


            <!ELEMENT persistence (persistence-unit*)>
            <!ELEMENT persistence-unit (description?,provider?,jta-datasource?,
            <!ATTLIST persistence-unit name CDATA #REQUIRED>
            <!ATTLIST persistence-unit transaction-type (JTA|RESOURCE_LOCAL) "JTA">
            <!ELEMENT description (#PCDATA)>
            <!ELEMENT provider (#PCDATA)>
            <!ELEMENT jta-datasource (#PCDATA)>
            <!ELEMENT non-jta-datasource (#PCDATA)>
            <!ELEMENT mapping-file (#PCDATA)>
            <!ELEMENT jar-file (#PCDATA)>
            <!ELEMENT class (#PCDATA)>
            <!ELEMENT exclude-unlisted-classes EMPTY>
            <!ELEMENT properties (property*)>
            <!ELEMENT property EMPTY>
            <!ATTLIST property name CDATA #REQUIRED>
            <!ATTLIST property value CDATA #REQUIRED>