Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16128

JPA entity auto scan not working with Hibernate 4

    XMLWordPrintable

Details

    • Migration, Compatibility/Configuration
    • Hide

      List all entity classes in persistence.xml

      Show
      List all entity classes in persistence.xml

    Description

      I am trying to deploy application that uses Hibernate 4 on EAP 7. When the application is deployed, JPA entity auto scan does not detect any entity classes.

      From what I managed to discover, the issue is with the org.hibernate.jpa.boot.archive.internal.JarInputStreamBasedArchiveDescriptor. Inside the visitArchive method there is the following code fragment:

      jarInputStream = new JarInputStream( getArchiveUrl().openStream() );
      

      The input stream does not contain any data and the:

      while ( ( jarEntry = jarInputStream.getNextJarEntry() ) != null ) { .. }
      

      loop never executes because there are no jar entries. I believe the issue is somehow related to VFS and the VirtualJarInputStream.

      I attached a sample Maven Eclipse project. It should fail with the Caused by: java.lang.IllegalArgumentException: Not an entity: class org.jboss.tools.examples.model.Member exception.

      The same issue exists on Wildfly 11 too.

      Attachments

        Activity

          People

            smarlow1@redhat.com Scott Marlow
            wujaszek Rafal Gala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: