2 Replies Latest reply on Sep 24, 2010 11:11 AM by srtielke

    JBoss 5.1 Shared persistence unit issue

    srtielke

      Hello.  I am in the process of upgrading my server from Jboss 4.3 to Jboss 5.1.  However, when I try to migrate all my current apps over (1 Seam War, 2 separate EJBs), I am getting an error with how my persistence-unit jar is referenced.  My apps are setup to share the same persistence classes by reference them in the jboss default lib directory.

       

      Here is my current persistence.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Persistence deployment descriptor for dev profile -->
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                   version="1.0">
                  
         <persistence-unit name="stms-ui" transaction-type="JTA">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/firstDatasource</jta-data-source>
            <jar-file>file:/C:\jboss-4.3\jboss-as\server\default\lib\persistence.jar</jar-file>
            <properties>
               .

               .

               .                              
            </properties>
         </persistence-unit>
         
      </persistence>

       

      However, when my server starts up, I get the following error.

       

      2010-09-17 14:05:35,370 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=#stms-ui state=Create
      java.lang.RuntimeException: could not find relative path: C:\jboss-4.3\jboss-as\server\default\lib\persistence.jar
          at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:208)
          at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:267)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

       

      It appears to load everything correctly after this error, but the server won't let me access my app because of the deployment error.  Is there a fix for this or a better way of handling shared persistence units in different wars and ears?

       

      Thanks,

      Sam