JBoss EAP 6.4 application with Hibernate 5.2 jboss.logging version conflict

Latest response

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:

  1. In jboss-deployment-structure.xml in the EAR/META-INF I put:
    to the deployment and also to the sub-deployment section.
  2. 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.
  3. I tried both 1) and 2) together.
  4. Added a module to the jboss-deplyoment-structure.xml referring to the jboss-logging.jar in the EAR.
  5. Put the jboss-logging.jar to the MANIFEST.MF Class-Path property.
  6. 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.

Thank you.



I ran into the same problem. Try to exclude org.jboss.resteasy.resteasy-jaxrs module too. It worked for me.

Regards Sisifo

Thank you for the hint, I will try it.