I was upgrading a hibernate
based project from 4.2.0
to 4.3.2
. The project is deployed in jboss-eap-6.4
as an .ear
The project works with jboss-as-jpa
. I have defined a persistance.xml in the .ear
which contains the following property
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.engine.transaction.jta.platform.internal.JBossAppServerJtaPlatform" />
(The package location of JBossAppServerJtaPlatform
has changed from org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform
to org.hibernate.engine.transaction.jta.platform.internal.JBossAppServerJtaPlatform
while upgrading from hibernate 4.2.0
to 4.3.2
.)
If i start jboss
it stops almost immediately and the following error appears in the server log.
17:40:26,412 WARN [org.jboss.modules] (ServerService Thread Pool -- 27) Failed to define class org.jboss.as.jpa.hibernate4.JBossAppServerJtaPlatform in Module "org.jboss.as.jpa.hibernate:4" from local module loader @757942a1 (finder: local module finder @4a87761d (roots: C:\AlanLal\jboss-eap-6.4\modules,C:\AlanLal\jboss-eap-6.4\modules\system\layers\base)): java.lang.LinkageError: Failed to link org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform (Module "org.jboss.as.jpa.hibernate:4" from local module loader @757942a1 (finder: local module finder @4a87761d (roots: C:\AlanLal\jboss-eap-6.4\modules,C:\AlanLal\jboss-eap-6.4\modules\system\layers\base)))
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.as.jpa.hibernate4.HibernatePersistenceProviderAdaptor.injectJtaManager(HibernatePersistenceProviderAdaptor.java:50)
at org.jboss.as.jpa.processor.PersistenceProviderAdaptorLoader.loadPersistenceAdapterModule(PersistenceProviderAdaptorLoader.java:117) [jboss-as-jpa-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.jpa.subsystem.JPAExtension.initialize(JPAExtension.java:110) [jboss-as-jpa-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.controller.extension.ExtensionAddHandler.initializeExtension(ExtensionAddHandler.java:97) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:139) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:125) [jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_172]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_172]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_172]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_172]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
Caused by: java.lang.NoClassDefFoundError: org/hibernate/service/jta/platform/internal/JBossAppServerJtaPlatform
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_172]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) [rt.jar:1.8.0_172]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.6.Final-redhat-1]
... 19 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform from [Module "org.jboss.as.jpa.hibernate:4" from local module loader @757942a1 (finder: local module finder @4a87761d (roots: C:\AlanLal\jboss-eap-6.4\modules,C:\AlanLal\jboss-eap-6.4\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
... 23 more
Upon further cause analysis i found a jar in jboss modules folder jboss-as-jpa-hibernate4-7.5.0.Final-redhat-21.jar
. A class in this jar still extends from org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform (hibernate 4.2.) which is causing the error to come
Things i tried out
I tried to a find a newer version of this jar in the redhat maven repo, But i couldn't find a suitable compatible version for Hibernate 4.3.0 (even the latest release still refers to org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform
)
I tried to upgrade to hibernate 5.
but couldn't find a compatible version of jboss-as-jpa-hibernate4-7.5.0.Final-redhat-21.jar
in their maven repo.
Is there anywhere else where I could find this jar compatible with hibernate 4.3.0 or even 5
, or could any other package in the mentioned repo serve the same purpose
EAP 6.4 supports Hibernate 4.2.18.Final out of the box. Using a different version is imho not recommended and will introduce some troubles. But in general it should be possible according to Hibernate. You will have to patch the server. More infos you can find e.g. here: https://docs.jboss.org/hibernate/orm/5.3/topical/html_single/wildfly/Wildfly.html
Beware that you might loose the EAP support from Redhat.