5 Replies Latest reply on Jan 12, 2012 4:49 AM by Paweł Kubica

    [AS7] Problem with entity mapping during deployment using jar-file in persistence.xml

    Paweł Kubica Newbie

      Hi,

       

      I'm trying to migrate an EE application from AS5.1 to AS7.0.2.Final and I'm having a problem with entity scanning/mapping form jar file.

      My application is bundled as an EAR with structure:

      ivsHW_EAR

      |

      |----ivsHW_EJB.jar

      |----ivsHW_WAR.war

      |----icsDatabaseStructore.jar

       

      The ivsHW_EJB.jar contains persistence.xml that references entities in icsDatabaseStructore.jar (jar-file entry in persistence.xml) but during deployment the entities aren't mapped to database structure. (packages are visible but entites not)

       

      When I move persistence.xml from ivsHW_EJB.jar to icsDatabaseStructore.jar everything is mapped correctly.

      It seams that there is still problem with entity scanning using "jar-file" in persistence.xml if persistence.xml is in different jar.

       

      Here are two logs:

      1) When persistence.xml is in ivsHW_EJB.jar and database isn't created (with TRACE on JPA and org.hibernate.ejb) http://pastebin.com/UjmQH3uU

      2) When persistence.xml is in icsDatabaseStructore.jar and everything is OK  http://pastebin.com/7ANTYm8B

       

      I'm also setuping hibernate 3 and having this same problem. (Even on last nightly build of AS7)

       

      My persistence.xml

       

          <persistence-unit name="ejb33" transaction-type="JTA">
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <jta-data-source>java:jboss/datasources/IVS_HW</jta-data-source>
              <jar-file>icsDataBaseStructure-0.0.1-SNAPSHOT.jar</jar-file>
              
              <properties>
                  <!-- <property name="jboss.as.jpa.providerModule" value="org.hibernate:3"/> -->
                  <property name="hibernate.dialect" value="org.hibernatespatial.postgis.PostgisDialect" />
                  <property name="hibernate.hbm2ddl.auto" value="update"/>
              </properties>
          </persistence-unit>
      

       

      Thanks in advance