0 Replies Latest reply on Jun 6, 2006 10:43 AM by luntain

    want to use relative path to external persistence unit jar

    luntain

      I have persistence-context.xml in backend jar but all the entities in seperate JAR. Inside persistence-context.xml I reference this jar (persistence-unit.jar).

      <persistence>
       <persistence-unit name="smarthome">
       <jta-data-source>java:/DefaultDS</jta-data-source>
      <jar-file>C:/tools/jboss/jboss-4.0.4.GA/server/default/deploy/persistence-unit-1.0-SNAPSHOT.jar</jar-file>
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
       <property name="hibernate.hbm2ddl.auto" value="update"/>
       </properties>
       </persistence-unit>
      </persistence>


      the problem is that it is absolute which is not acceptable.

      I noticed that when I put just the jar name I get exception that this file was not found in bin directory of jboss.

      The strange thing was that when I tried ../persistence-unit-1.0-SNAPSHOT.jar it was not trying to resolve it relativly to bin directory but rather to EAR (my backend JAR is packed inside EAR, sorry if it is getting to complicated). So this works quite well for me since persistence-unit.jar is inside EAR but I am not sure about this solution. Is it documented somewhere?