1 2 Previous Next 22 Replies Latest reply on Nov 4, 2011 12:16 PM by garcimouche

    JPA Entities scanning issue (jar-file in persistence.xml)

    garcimouche

      I'm migrating an EE application from AS6 to AS7.0.2.Final.

       

      My app is bundled as an EAR. The persistence xml references entities with the jar-file xml element but it seems the jar files are not scanned at all!

       

      I also tried to setup Hibernate 3 thinking that the version 4 bundled with the server could be the problem but I have the same result.

       

      Thanks in advance

       

      (The exact same file was working with Hib 3.6 on AS6)

       

      <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_2_0.xsd"
         version="2.0">
      
         <persistence-unit name="acme">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/acmeDatasource</jta-data-source>
                 <jar-file>lib/acme-release-domain-0.0.1-SNAPSHOT.jar</jar-file>
                 <jar-file>lib/acme-lvs-domain-0.0.1-SNAPSHOT.jar</jar-file>
            <jar-file>lib/acme-rmd-domain-0.0.1-SNAPSHOT.jar</jar-file>
            <jar-file>lib/acme-another-domain-0.0.1-SNAPSHOT.jar</jar-file>
            <jar-file>lib/acme-parties-domain-0.0.1-SNAPSHOT.jar</jar-file>
            <properties>
               <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
               <!-- TODO define a m2 profile to filter this out -->
               <property name="hibernate.hbm2ddl.auto" value="create-drop" />
               <property name="hibernate.show_sql" value="true" />
               <property name="hibernate.format_sql" value="true" />
               <property name="javax.persistence.validation.group.pre-update" value="com.acme.validation.MyPersistRules"/>
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/acmeEntityManagerFactory" />
               <property name="hibernate.ejb.interceptor" value="com.acme.interceptor.EntityMaintenanceFieldsInterceptor" />
            </properties>
         </persistence-unit>
      
      </persistence>
      
        1 2 Previous Next