8 Replies Latest reply on Sep 20, 2016 10:25 PM by Manh Phan

    WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10

    Juergen Zimmermann Master

      I tried to add Hibernate 4.3.10 so that I still can use PicketLink - without success. Any hint is appreciated!

       

      So far I did the following:

      1) In $JBOSS_HOME/modules/system/layers/base/org/hibernate/4.3 I copied these JARs:

      hibernate-commons-annotations-4.0.5.Final.jar

      hibernate-core-4.3.10.Final.jar
      hibernate-entitymanager-4.3.10.Final.jar
      hibernate-infinispan-4.3.10.Final.jar

       

      2) I edited $JBOSS_HOME/modules/system/layers/base/org/hibernate/4.3/module.xml:

      <module xmlns="urn:jboss:module:1.3" name="org.hibernate" slot="4.3">
          <resources>
              <resource-root path="hibernate-core-4.3.10.Final.jar"/>
              <resource-root path="hibernate-entitymanager-4.3.10.Final.jar"/>
              <resource-root path="hibernate-commons-annotations-4.0.5.Final.jar"/>
              <resource-root path="hibernate-infinispan-4.3.10.Final.jar"/>
          </resources>

          <dependencies>
              <module name="asm.asm"/>
              <module name="com.fasterxml.classmate"/>
              <module name="javax.api"/>
              <module name="javax.annotation.api"/>
              <module name="javax.enterprise.api"/>
              <module name="javax.persistence.api"/>
              <module name="javax.transaction.api"/>
              <module name="javax.validation.api"/>
              <module name="javax.xml.bind.api"/>
              <module name="org.antlr"/>
              <module name="org.apache.commons.collections"/>
              <module name="org.dom4j"/>
              <module name="org.javassist"/>
              <module name="org.jboss.as.jpa.spi"/>
              <module name="org.jboss.jandex"/>
              <module name="org.jboss.logging"/>
              <module name="org.jboss.vfs"/>
              <module name="org.hibernate.jipijapa-hibernate4-3" services="import"/>
          </dependencies>
      </module>

       

      3) I changed my persistence.xml (part of a WAR):

      <persistence ...>

         <persistence-unit name="default">   <!-- SHOULD WORK WITH HIBERNATE 5 -->
           <jta-data-source>java:jboss/datasources/shop</jta-data-source>

           ...

         <persistence-unit name="picketlink-default">   <!-- NEEDS HIBERNATE 4.3 -->

            <jta-data-source>java:jboss/datasources/identity</jta-data-source>

            ...

            <properties>

               ...

               <property name="jboss.as.jpa.providerModule" value="org.hibernate:4.3"/>  <!-- NEWLY ADDED -->

       

       

       

       

      4) The stacktrace during deployment:

      ERROR [org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.persistenceunit."shop.war#default".__FIRST_PHASE__: org.jboss.msc.service.StartException in service jboss.persistenceunit."shop.war#default".__FIRST_PHASE__: java.util.ServiceConfigurationError: org.hibernate.boot.registry.selector.StrategyRegistrationProvider: Provider org.hibernate.cache.infinispan.StrategyRegistrationProviderImpl not a subtype

      at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:120)

      at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:102)

      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:670)

      at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1.run(PhaseOnePersistenceUnitServiceImpl.java:129)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      at java.lang.Thread.run(Thread.java:745)

      at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: java.util.ServiceConfigurationError: org.hibernate.boot.registry.selector.StrategyRegistrationProvider: Provider org.hibernate.cache.infinispan.StrategyRegistrationProviderImpl not a subtype

      at java.util.ServiceLoader.fail(ServiceLoader.java:239)

      at java.util.ServiceLoader.access$300(ServiceLoader.java:185)

      at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)

      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)

      at java.util.ServiceLoader$1.next(ServiceLoader.java:480)

      at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:324)

      at org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder.buildSelector(StrategySelectorBuilder.java:155)

      at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:221)

      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:288)

      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:161)

      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:144)

      at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:28)

      at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:40)

      at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.<init>(TwoPhaseBootstrapImpl.java:39)

      at org.jboss.as.jpa.hibernate5.HibernatePersistenceProviderAdaptor.getBootstrap(HibernatePersistenceProviderAdaptor.java:159)

      at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.createContainerEntityManagerFactoryBuilder(PhaseOnePersistenceUnitServiceImpl.java:242)

      at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.access$800(PhaseOnePersistenceUnitServiceImpl.java:59)

      at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:117)

      ... 7 more

        • 1. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
          Scott Marlow Master

          Try merging the modules/system/layers/base/org/hibernate/infinispan/main/module.xml settings into your new 4.3 module, so that Infinispan classes are resolved.  Another approach might be to remove the "hibernate-infinispan-4.3.10.Final.jar" file from the 4.3 module.xml (let us know if you try that).

           

          I think that you just need to add:

              <module name="org.infinispan" services="import"/>
              <module name="org.infinispan.commons"/>

           

           

           

          or the full module.xml:

          $JBOSS_HOME/modules/system/layers/base/org/hibernate/4.3/module.xml:
          
          <module xmlns="urn:jboss:module:1.3" name="org.hibernate" slot="4.3">
              <resources>
                  <resource-root path="hibernate-core-4.3.10.Final.jar"/>
                  <resource-root path="hibernate-entitymanager-4.3.10.Final.jar"/>
                  <resource-root path="hibernate-commons-annotations-4.0.5.Final.jar"/>
                  <resource-root path="hibernate-infinispan-4.3.10.Final.jar"/>
              </resources>
          
              <dependencies>
                  <module name="asm.asm"/>
                  <module name="com.fasterxml.classmate"/>
                  <module name="javax.api"/>
                  <module name="javax.annotation.api"/>
                  <module name="javax.enterprise.api"/>
                  <module name="javax.persistence.api"/>
                  <module name="javax.transaction.api"/>
                  <module name="javax.validation.api"/>
                  <module name="javax.xml.bind.api"/>
                  <module name="org.antlr"/>
                  <module name="org.apache.commons.collections"/>
                  <module name="org.dom4j"/>
                  <module name="org.javassist"/>
                  <module name="org.jboss.as.jpa.spi"/>
                  <module name="org.jboss.jandex"/>
                  <module name="org.jboss.logging"/>
                  <module name="org.jboss.vfs"/>
                  <module name="org.hibernate.jipijapa-hibernate4-3" services="import"/>
                  <module name="org.infinispan" services="import"/>
                  <module name="org.infinispan.commons"/>
              </dependencies>
          </module>
          
          

           

          Or you could try removing Infinispan. 

           

          $JBOSS_HOME/modules/system/layers/base/org/hibernate/4.3/module.xml:
          
          <module xmlns="urn:jboss:module:1.3" name="org.hibernate" slot="4.3">
              <resources>
                  <resource-root path="hibernate-core-4.3.10.Final.jar"/>
                  <resource-root path="hibernate-entitymanager-4.3.10.Final.jar"/>
                  <resource-root path="hibernate-commons-annotations-4.0.5.Final.jar"/>
              </resources>
          
              <dependencies>
                  <module name="asm.asm"/>
                  <module name="com.fasterxml.classmate"/>
                  <module name="javax.api"/>
                  <module name="javax.annotation.api"/>
                  <module name="javax.enterprise.api"/>
                  <module name="javax.persistence.api"/>
                  <module name="javax.transaction.api"/>
                  <module name="javax.validation.api"/>
                  <module name="javax.xml.bind.api"/>
                  <module name="org.antlr"/>
                  <module name="org.apache.commons.collections"/>
                  <module name="org.dom4j"/>
                  <module name="org.javassist"/>
                  <module name="org.jboss.as.jpa.spi"/>
                  <module name="org.jboss.jandex"/>
                  <module name="org.jboss.logging"/>
                  <module name="org.jboss.vfs"/>
                  <module name="org.hibernate.jipijapa-hibernate4-3" services="import"/>
              </dependencies>
          </module>
          
          
          
          • 2. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
            Juergen Zimmermann Master

            Both approaches don't work.

            1) When I add the two dependency entries for Infinispan, then I get this stacktrace:

            ERROR [org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.persistenceunit."shop.war#default".__FIRST_PHASE__: org.jboss.msc.service.StartException in service jboss.persistenceunit."shop.war#default".__FIRST_PHASE__: java.util.ServiceConfigurationError: org.hibernate.boot.registry.selector.StrategyRegistrationProvider: Provider org.hibernate.cache.infinispan.StrategyRegistrationProviderImpl not a subtype

            at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:120)

            at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:102)

            at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:670)

            at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1.run(PhaseOnePersistenceUnitServiceImpl.java:129)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

            at java.lang.Thread.run(Thread.java:745)

            at org.jboss.threads.JBossThread.run(JBossThread.java:320)

            Caused by: java.util.ServiceConfigurationError: org.hibernate.boot.registry.selector.StrategyRegistrationProvider: Provider org.hibernate.cache.infinispan.StrategyRegistrationProviderImpl not a subtype

            at java.util.ServiceLoader.fail(ServiceLoader.java:239)

            at java.util.ServiceLoader.access$300(ServiceLoader.java:185)

            at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)

            at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)

            at java.util.ServiceLoader$1.next(ServiceLoader.java:480)

            at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:324)

            at org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder.buildSelector(StrategySelectorBuilder.java:155)

            at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:221)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:288)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:161)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:144)

            at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:28)

            at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:40)

            at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.<init>(TwoPhaseBootstrapImpl.java:39)

            at org.jboss.as.jpa.hibernate5.HibernatePersistenceProviderAdaptor.getBootstrap(HibernatePersistenceProviderAdaptor.java:159)

            at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.createContainerEntityManagerFactoryBuilder(PhaseOnePersistenceUnitServiceImpl.java:242)

            at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.access$800(PhaseOnePersistenceUnitServiceImpl.java:59)

            at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:117)

            ... 7 more

             

            2) When I remove the resource-root entry for Infinispan, then I get this stacktrace:

            ERROR [org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.persistenceunit."shop.war#default": org.jboss.msc.service.StartException in service jboss.persistenceunit."shop.war#default": org.hibernate.AnnotationException: Unknown Id.generator: uuid

            at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)

            at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)

            at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:670)

            at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

            at java.lang.Thread.run(Thread.java:745)

            at org.jboss.threads.JBossThread.run(JBossThread.java:320)

            Caused by: org.hibernate.AnnotationException: Unknown Id.generator: uuid

            at org.hibernate.cfg.BinderHelper.makeIdGenerator(BinderHelper.java:644)

            at org.hibernate.cfg.AnnotationBinder.processId(AnnotationBinder.java:2331)

            at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2236)

            at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:904)

            at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:731)

            at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:245)

            at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:220)

            at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:263)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:770)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:797)

            at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)

            at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)

            ... 7 more

            • 3. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
              Juergen Zimmermann Master

              I also tried to define both PUs in persistence.xml to use Hibernate 4.3 - so far the 1st PU should use Hibernate 5, the 2nd should use Hibernate 4.3 due to PicketLink.

               

              However, I get the same stacktrace (both for adding the 2 depencency entries and for removing the resource-root entry):

              [org.jboss.modules] Failed to define class org.jboss.as.jpa.hibernate4.HibernateArchiveScanner in Module "org.hibernate.jipijapa-hibernate4-3:main" from local module loader @2f333739 (finder: local module finder @77468bd9 (roots: C:\Zimmermann\wildfly-10.0.0.Alpha6\modules,C:\Zimmermann\wildfly-10.0.0.Alpha6\modules\system\layers\base)): java.lang.LinkageError: Failed to link org/jboss/as/jpa/hibernate4/HibernateArchiveScanner (Module "org.hibernate.jipijapa-hibernate4-3:main" from local module loader @2f333739 (finder: local module finder @77468bd9 (roots: C:\Zimmermann\wildfly-10.0.0.Alpha6\modules,C:\Zimmermann\wildfly-10.0.0.Alpha6\modules\system\layers\base)))

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437)

              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)

              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)

              at org.jboss.modules.Module.loadModuleClass(Module.java:560)

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)

              at org.jboss.as.jpa.hibernate4.HibernatePersistenceProviderAdaptor.addProviderProperties(HibernatePersistenceProviderAdaptor.java:93)

              at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deployPersistenceUnitPhaseOne(PersistenceUnitServiceHandler.java:485)

              at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:273)

              at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleWarDeployment(PersistenceUnitServiceHandler.java:200)

              at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:129)

              at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at java.lang.Thread.run(Thread.java:745)

              Caused by: java.lang.NoClassDefFoundError: org/hibernate/jpa/boot/scan/spi/Scanner

              at java.lang.ClassLoader.defineClass1(Native Method)

              at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)

              ... 20 more

              Caused by: java.lang.ClassNotFoundException: org.hibernate.jpa.boot.scan.spi.Scanner from [Module "org.hibernate.jipijapa-hibernate4-3:main" from local module loader @2f333739 (finder: local module finder @77468bd9 (roots: C:\Zimmermann\wildfly-10.0.0.Alpha6\modules,C:\Zimmermann\wildfly-10.0.0.Alpha6\modules\system\layers\base))]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)

              ... 24 more

              • 4. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
                Scott Marlow Master

                I think that the application needs to use Hibernate 4.3 for both persistence units, since a dependency on the persistence provider is added to the application (automatically).  So, either all persistence units need to be Hibernate ORM 5.0 or 4.3 based.

                • 5. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
                  Tomaz Cerar Master

                  Juergen,

                   

                  what is the problem with PicketLink and hibernate 5?

                  I think it should work, otherwise it is a bug, we do ship it's subsystem and as such it should work on components app server ships with out of the box.

                  • 6. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
                    Juergen Zimmermann Master

                    Tomaz, I assumed that PicketLink requires Hibernate 4 because the release date is somewhere in the past. Now, I just tried WildFly with the preconfigured Hibernate 5: everything works fine. Thank you!

                    If you and Scott are interested in examining the CNFE above, I can try to help.

                    • 7. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
                      Scott Marlow Master

                      using Hibernate 5 for both persistence units should also work.

                      • 8. Re: WildFly 10.0.0.Alpha6: cannot add Hibernate 4.3.10
                        Manh Phan Newbie

                        The following steps and it work:

                        1> In $JBOSS_HOME/modules/system/layers/base/org/hibernate/4.3

                        hibernate-commons-annotations-4.0.5.Final.jar

                        hibernate-core-4.3.10.Final.jar

                        hibernate-entitymanager-4.3.10.Final.jar

                        jipijapa-hibernate4-3-1.0.1.Final.jar

                         

                        2 > $JBOSS_HOME/modules/system/layers/base/org/hibernate/4.3/module.xml:

                                 

                        <?xml version="1.0" encoding="UTF-8"?>

                        <module xmlns="urn:jboss:module:1.3" name="org.hibernate" slot="4.3">

                            <resources>

                                <resource-root path="hibernate-core-4.3.10.Final.jar"/>

                          <resource-root path="hibernate-commons-annotations-4.0.5.Final.jar"/>

                                <resource-root path="hibernate-entitymanager-4.3.10.Final.jar"/>

                          <resource-root path="jipijapa-hibernate4-3-1.0.1.Final.jar"/>

                            </resources>

                         

                         

                            <dependencies>

                                <module name="asm.asm"/>

                                <module name="com.fasterxml.classmate"/>

                                <module name="javax.api"/>

                                <module name="javax.annotation.api"/>

                                <module name="javax.enterprise.api"/>

                                <module name="javax.persistence.api"/>

                                <module name="javax.transaction.api"/>

                                <module name="javax.validation.api"/>

                                <module name="javax.xml.bind.api"/>

                                <module name="org.antlr"/>

                                <module name="org.apache.commons.collections"/>

                                <module name="org.dom4j"/>

                                <module name="org.javassist"/>

                                <module name="org.jboss.as.jpa.spi"/>

                                <module name="org.jboss.jandex"/>

                                <module name="org.jboss.logging"/>

                                <module name="org.jboss.vfs"/>

                            </dependencies>

                        </module>

                         

                        3) persistence.xml

                        <?xml version="1.0" encoding="UTF-8"?>

                        <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

                          <persistence-unit name="JpaPersistence"

                          transaction-type="JTA">

                          <description>Hibernate 4 Persistence Unit.</description>

                          <jta-data-source>java:/abc</jta-data-source>

                          <properties>

                          <property name="jboss.as.jpa.providerModule" value="org.hibernate:4.3"/>

                          </properties>

                          </persistence-unit>

                        </persistence>

                         

                        I hope that will work in your case