I have been trying to deploy an application which uses Hibernate 3.6, on Wildfly8.1.
My application is an EAR, which consists of a war and ejb.jar. After trying out several other things, I found this solution which seemed promising: https://developer.jboss.org/message/882769
As per this solution, I have specified the correct provider for hibernate 3.6 and included all the jar files needed in the lib directory, but this does not work!
I also found this link to be helpful:
Any help would be greatly appreciated!!
Please find the error in the server log below:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."xyz.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."xyz.ear".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of deployment "xyz.ear" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71] Caused by: java.lang.LinkageError: Failed to link org/hibernate/ejb/HibernatePersistence (Module "deployment.xyz.ear:main" from Service Module Loader) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final] at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:74) at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.1.0.Final.jar:8.1.0.Final] ... 5 more Caused by: java.lang.NoClassDefFoundError: javax/persistence/spi/PersistenceProvider at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_71] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_71] at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.3.Final] ... 16 more Caused by: java.lang.ClassNotFoundException: javax.persistence.spi.PersistenceProvider from [Module "deployment.xyz.ear:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final] ... 20 more
15:12:01,051 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "jsr77")]) - failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => { "Services that were unable to start:" => ["jboss.jsr77.ejb"], "Services that may be the cause:" => [ "jboss.io.worker.default", "jboss.remoting.remotingConnectorInfoService.remoting-connector", "jboss.web.common.server" ] }} 15:12:01,122 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "remoting")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.remoting.endpoint.subsystem is missing [jboss.io.worker.default]"]} 15:12:01,135 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "xyz.ear")]) - failure description: { "JBAS014671: Failed services" => {"jboss.deployment.unit.\"xyz.ear\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"xyz.ear\".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of deployment \"xyz.ear\" Caused by: java.lang.LinkageError: Failed to link org/hibernate/ejb/HibernatePersistence (Module \"deployment.xyz.ear:main\" from Service Module Loader) Caused by: java.lang.NoClassDefFoundError: javax/persistence/spi/PersistenceProvider Caused by: java.lang.ClassNotFoundException: javax.persistence.spi.PersistenceProvider from [Module \"deployment.xyz.ear:main\" from Service Module Loader]"}, "JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => { "Services that were unable to start:" => [ "jboss.deployment.subunit.\"xyz.ear\".\"xyz-ejb.jar\".FIRST_MODULE_USE", "jboss.deployment.subunit.\"xyz.ear\".\"xyz.war\".FIRST_MODULE_USE" ], "Services that may be the cause:" => [ "jboss.io.worker.default", "jboss.remoting.remotingConnectorInfoService.remoting-connector", "jboss.web.common.server" ] } } 15:12:01,436 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "webservices")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.ws.config is missing [jboss.web.common.server]"]} 15:12:01,450 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([ ("subsystem" => "naming"), ("service" => "remote-naming") ]) - failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => { "Services that were unable to start:" => ["jboss.naming.remote"], "Services that may be the cause:" => [ "jboss.io.worker.default", "jboss.remoting.remotingConnectorInfoService.remoting-connector", "jboss.web.common.server" ] }} 15:12:01,940 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([ ("subsystem" => "ejb3"), ("service" => "remote") ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.ejb3.connector is missing [jboss.remoting.remotingConnectorInfoService.remoting-connector]"]} 15:12:02,393 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "xyz.ear" (runtime-name : "xyz.ear") 15:12:02,570 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report JBAS014775: New missing/unsatisfied dependencies: service jboss.io.worker.default (missing) dependents: [service jboss.remoting.endpoint.subsystem] service jboss.remoting.remotingConnectorInfoService.remoting-connector (missing) dependents: [service jboss.ejb3.connector] service jboss.web.common.server (missing) dependents: [service jboss.ws.config] JBAS014777: Services which failed to start: service jboss.deployment.unit."xyz.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."xyz.ear".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of deployment "xyz.ear"
Ok, the application is now loading in wildfly 8.1.0.Final. We ended up upgrading Hibernate to 4.1 (packaged by default with Wildfly). And since this is the default, a 'provider' tag was not necessary. We changed, 2 XML files i.e. jboss-deployment-structure.xml & persistence.xml and a java file in the application (which consisted of ServiceLocator).