3 Replies Latest reply on Aug 31, 2016 2:53 PM by Scott Marlow

    Hibernate 4 with Wildfly 10

    Rajitha Gunawardhane Newbie

      WhatHi,

       

      I have try to deploy hibernate4 quick start app in wildfly 10 but it is giving this error.

       

      13:34:19,140 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."wildfly-hibernate4.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."wildfly-hibernate4.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "wildfly-hibernate4.war"

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

          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(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

      Caused by: javax.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.jpa.HibernatePersistenceProvider' not found

          at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:1007)

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

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

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

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

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

          ... 5 more

       

      13:34:19,142 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "wildfly-hibernate4.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"wildfly-hibernate4.war\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"wildfly-hibernate4.war\".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"wildfly-hibernate4.war\"

          Caused by: javax.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.jpa.HibernatePersistenceProvider' not found"}}

      13:34:19,196 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "wildfly-hibernate4.war" (runtime-name : "wildfly-hibernate4.war")

      13:34:19,203 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report

      WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."wildfly-hibernate4.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."wildfly-hibernate4.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "wildfly-hibernate4.war"

       

      Persistence xml,

       

      <persistence version="2.1"

         xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="

              http://xmlns.jcp.org/xml/ns/persistence

              http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">

         <persistence-unit name="primary">

         

            <!-- If you are running in a production environment, add a managed

               data source, this example data source is just for devleopment and testing! -->

            <!-- The datasource is deployed as WEB-INF/hibernate4-quickstart-ds.xml, you

               can find it in the source at src/main/webapp/WEB-INF/hibernate4-quickstart-ds.xml -->

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

            <properties>

               <!-- Properties for Hibernate -->

               <property name="hibernate.hbm2ddl.auto" value="create-drop" />

               <property name="hibernate.show_sql" value="false" />

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

            </properties>

         </persistence-unit>

      </persistence>

       

      deployment-descripter.xml

       

      <jboss-deployment-structure>

        <ear-subdeployments-isolated>true</ear-subdeployments-isolated>

        <deployment>

        

          <exclusions>

               <module name="org.hibernate" />

          </exclusions>

          <dependencies>

               <module name="org.hibernate" slot="4"/>

         

          </dependencies>

        </deployment>

       

      </jboss-deployment-structure>

       

       

       

       

      What could be the issue???

        • 1. Re: Hibernate 4 with Wildfly 10
          Scott Marlow Master

          Which Hibernate version exactly are you using?  Show us  the contents of the wildfly/modules/system/layers/base/org/hibernate/* that you setup with the Hibernate 4.something version.

           

          Scott

          • 2. Re: Hibernate 4 with Wildfly 10
            Rajitha Gunawardhane Newbie

            Hi Scott,

            I am following hibernate quick start for wildfly 10. Hibernate4 project. Please see below for hibernate modules. 3.5 and 3.4 i have created for test. But later i got to know that 3.X is now removed (This is in other thread. You help with that too )

            hibernateModule.png

            I have change some files Now i am getting following error

             

            08:59:25,952 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.module.service."deployment.wildfly-hibernate4.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.wildfly-hibernate4.war".main: WFLYSRV0179: Failed to load module: deployment.wildfly-hibernate4.war:main

                at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91)

                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(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

            Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\infra\migrate\wildfly-10.0.0.Final\modules\system\layers\base\org\hibernate\4.3\module.xml

                at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:228)

                at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:204)

                at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:170)

                at org.jboss.modules.LocalModuleFinder.lambda$findModule$3(LocalModuleFinder.java:149)

                at java.security.AccessController.doPrivileged(Native Method)

                at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:144)

                at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:439)

                at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:342)

                at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:289)

                at org.jboss.modules.Module.addPaths(Module.java:1078)

                at org.jboss.modules.Module.link(Module.java:1448)

                at org.jboss.modules.Module.relinkIfNecessary(Module.java:1476)

                at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:225)

                at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:74)

                ... 5 more

            Caused by: org.jboss.modules.xml.XmlPullParserException: Unknown attribute "services" from namespace "" (position: START_TAG seen ...ct name="${org.wildfly:jipijapa-hibernate4-3}" services="import"/>... @28:82)

                at org.jboss.modules.xml.ModuleXmlParser.unknownAttribute(ModuleXmlParser.java:285)

                at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:817)

                at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:739)

                at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:535)

                at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:340)

                at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:226)

                ... 18 more

             

            08:59:25,957 ERROR [org.jboss.as.controller.management-operation] (management task-3) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "wildfly-hibernate4.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.wildfly-hibernate4.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.wildfly-hibernate4.war\".main: WFLYSRV0179: Failed to load module: deployment.wildfly-hibernate4.war:main

                Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\\infra\\migrate\\wildfly-10.0.0.Final\\modules\\system\\layers\\base\\org\\hibernate\\4.3\\module.xml

                Caused by: org.jboss.modules.xml.XmlPullParserException: Unknown attribute \"services\" from namespace \"\" (position: START_TAG seen ...ct name=\"${org.wildfly:jipijapa-hibernate4-3}\" services=\"import\"/>... @28:82) "}}

            08:59:25,958 ERROR [org.jboss.as.server] (management task-3) WFLYSRV0021: Deploy of deployment "wildfly-hibernate4.war" was rolled back with the following failure message:

            {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.wildfly-hibernate4.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.wildfly-hibernate4.war\".main: WFLYSRV0179: Failed to load module: deployment.wildfly-hibernate4.war:main

                Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\\infra\\migrate\\wildfly-10.0.0.Final\\modules\\system\\layers\\base\\org\\hibernate\\4.3\\module.xml

                Caused by: org.jboss.modules.xml.XmlPullParserException: Unknown attribute \"services\" from namespace \"\" (position: START_TAG seen ...ct name=\"${org.wildfly:jipijapa-hibernate4-3}\" services=\"import\"/>... @28:82) "}}

            08:59:25,978 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment wildfly-hibernate4.war (runtime-name: wildfly-hibernate4.war) in 18ms

            08:59:25,979 INFO  [org.jboss.as.controller] (management task-3) WFLYCTL0183: Service status report

            WFLYCTL0184:    New missing/unsatisfied dependencies:

                  service jboss.module.service."deployment.wildfly-hibernate4.war".main (missing) dependents: [service jboss.deployment.unit."wildfly-hibernate4.war".FIRST_MODULE_USE]

            WFLYCTL0186:   Services which failed to start:      service jboss.module.service."deployment.wildfly-hibernate4.war".main

             

            Deployment structure

             

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

            <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

             

                <deployment>

                  

                    <exclusions>

                        <module name="org.hibernate" slot="main" />

                      

                    </exclusions>

                    <dependencies>

                       <module name="org.hibernate.jipijapa-hibernate4-3" slot="main" />

                      

                    </dependencies>

                </deployment>

             

            </jboss-deployment-structure>

             

            POM

             

            <dependency>

                        <groupId>org.hibernate</groupId>

                        <artifactId>hibernate-core</artifactId>

                        <version>4.3.11.Final</version>

                    </dependency>

            • 3. Re: Hibernate 4 with Wildfly 10
              Scott Marlow Master

              Can you show us the contents of C:\infra\migrate\wildfly-10.0.0.Final\modules\system\layers\base\org\hibernate\4.3\module.xml?  The "${org.wildfly:jipijapa-hibernate4-3}" reference in the above error is likely pointing to the problem.  I think that line in your module.xml should read:

              <module name="org.hibernate.jipijapa-hibernate4-3" services="import"/>