[jboss-jira] [JBoss JIRA] (AS7-2497) JPA Entities not get scanned when referenced in jar-file element of persistence.xml

Franck Garcia (Created) (JIRA) jira-events at lists.jboss.org
Thu Nov 3 10:36:46 EDT 2011


JPA Entities not get scanned when referenced in jar-file element of persistence.xml
-----------------------------------------------------------------------------------

                 Key: AS7-2497
                 URL: https://issues.jboss.org/browse/AS7-2497
             Project: Application Server 7
          Issue Type: Bug
          Components: JPA / Hibernate
    Affects Versions: 7.0.2.Final
         Environment: ubuntu 11.04, java Hotspot 1.6.0_27
            Reporter: Franck Garcia
            Assignee: Scott Marlow


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!
The persistence.xml file is inside an ejb-jar module and the jar files are in the ear lib directory.
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.
(was working with JBoss AS 6.0.0.Final)

<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>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list