Conflicting Hibernate Versions during Deployment
iamatoffice Jul 19, 2016 4:58 AMHello,
I have a little problem concerning a web app deployment on wildfly 10 and Hibernate. Unfortunately an error is reported while deploying:
09:27:42,001 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 70) MSC000001: Failed to start service jboss.persistenceunit."eamp-repository-services-ear-1.3.0-SNAPSHOT.ear/eamp-repository-services-ws.war#eamp": org.jboss.msc.service.StartException in service jboss.persistenceunit."eamp-repository-services-ear-1.3.0-SNAPSHOT.ear/eamp-repository-services-ws.war#eamp": java.lang.AbstractMethodError 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:667) 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: java.lang.AbstractMethodError at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:278) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) 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 09:27:42,003 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"eamp-repository-services-ear-1.3.0-SNAPSHOT.ear/eamp-repository-services-ws.war#eamp\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"eamp-repository-services-ear-1.3.0-SNAPSHOT.ear/eamp-repository-services-ws.war#eamp\": java.lang.AbstractMethodError Caused by: java.lang.AbstractMethodError"}}
I already figured out that this has something to do with equal libraries (possibly different versions) which are located on server libs as well as in the EAR/WAR deployment libs. For some reasons, it's necessary to use the libs which are included in the lib of the deployment instead of the container based libs. In addition, I tried to exclude the server located hibernate libs by creating a jboss-deployment-structure.xml.
<jboss-deployment-structure> <ear-subdeployments-isolated>false</ear-subdeployments-isolated> <sub-deployment name="eamp-repository-services-ws.war" > <exclusions> <module name="org.hibernate" /> </exclusions> </sub-deployment> </jboss-deployment-structure>
The jboss-deployment-structure.xml is located in the META-INF of the EAR. This EAR contains another WAR file.
But this does not lead to an expected result and the web application is still not deployable on Wildfly10.
Are there any suggestions or solutions which deal with this problem?