I upgraded an enterprise application to use Hibernate 5.2.12, which depends on jboss-logging-3.3.0.Final. The jboss-logging-3.3.0.Final.jar is shipped together with the hibernate-5.2 jars in the EAR/lib.
Hibernate fails when trying to invoke a method on org.jboss.logging.Logger which is not available in JBoss' system module org.jboss.logging, because it provides an older version jboss-logging-3.1.4.GA-redhat-2 ( Exception is: java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V"},)
I tried several solution approaches:
- In jboss-deployment-structure.xml in the EAR/META-INF I put:
to the deployment and also to the sub-deployment section.
- I created another module org.jboss.logging with slot=3.3. In jboss-deployment-structure.xml I put: to the deployment and also to the sub-deployment section.
- I tried both 1) and 2) together.
- Added a module to the jboss-deplyoment-structure.xml referring to the jboss-logging.jar in the EAR.
- Put the jboss-logging.jar to the MANIFEST.MF Class-Path property.
- Added also a module for hibernate 5.2 refferring to the hibernate jar in the EAR, whith a dependency to the jboss-logging-module of the EAR. Then other problems occur (java.lang.IllegalAccessError: tried to access class org.jboss.logging.LoggerProviders from class org.jboss.logging.Logger)
So none of these approaches worked.
From JBoss AS documentation and some other forum hints I got the information that this are the possibilities to use other specific versions of system modules shipped by JBoss itself, and it works for example for hibernate, but not for jboss-logging for some reason.
What worked was to replace the original system module org.jboss.logging (slot main) with the jboss-logging-3.3.0.Final, and put nothing to jboss-deployment-structure.xml. But I'm afraid that our customers don't want to do this "non official patch" because the might lose RedHat support then.