Hibernate 4 with Wildfly 10
dvrajitha Aug 29, 2016 4:10 AMWhatHi,
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???