0 Replies Latest reply on Mar 2, 2006 6:01 AM by Jason Hambleton

    jar-file dependencies in persistence.xml

    Jason Hambleton Newbie

      We are converting a very large multi-module software package from EJB2.1 BMP to EJB3 CMP. Accessing entities from another jar file requires that the persistence.xml file lists the jar file using the "<jar-file>../One.jar</jar-file>" syntax.

      Any jar dependencies from the persistence.xml file in "One.jar" also need to be listed in the persistence.xml file in "Two.jar" for the system to load without exceptions.

      Can somebody explain why these dependencies cannot be resolved at run-time. Here's an example: -

      One.jar
      --------
      <persistence>
       <persistence-unit>
       <jar-data-source>java:/db</jta-data-source>
       </persistence-unit>
      </persistence>
      
      
      Two.jar
      --------
      <persistence>
       <persistence-unit>
       <jar-data-source>java:/db</jta-data-source>
       <jar-file>../One.jar</jar-file>
       </persistence-unit>
      </persistence>
      
      Three.jar
      --------
      <persistence>
       <persistence-unit>
       <jar-data-source>java:/db</jta-data-source>
       <jar-file>../Two.jar</jar-file>
       <jar-file>../One.jar</jar-file>
       </persistence-unit>
      </persistence>


      In this example, why do I have to include "One.jar" in the last persistence.xml file, why can it not be resolved automatically.

      I am using 4.0.3 with EJB3-RC5.

      Cheers,
      Kato.