Unable to start the JBoss EAP 6.4.x due to hibernate cache related error

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.4.x

Issue

  • After migrating the JBoss server from EAP 6.3.x (or earlier) to 6.4.x below exception is seen in server log file:
 Caused by: java.util.ServiceConfigurationError: org.infinispan.commands.module.ModuleCommandExtensions: Provider org.hibernate.cache.infinispan.util.CacheCommandExtensions not a subtype

Resolution

Workaround:

  • Add an exclusion and dependency of org.hibernate module in jboss-deployment-structure.xml:
 <jboss-deployment-structure>
    <deployment>
       <exclusions>
           <module name="org.hibernate" />
       </exclusions>
       <dependencies>
           <module name="org.hibernate" />
       </dependencies>
    </deployment>
 </jboss-deployment-structure>

The same exclusion and dependencies element might need to be added to the inner subdeployment element as well.

    <sub-deployment name="some-inner-module.jar">
       <exclusions>
           <module name="org.hibernate" />
       </exclusions>
       <dependencies>
           <module name="org.hibernate" />
       </dependencies>
    </sub-deployment>

Root Cause

  • The dependencies added automatically to a JPA application expose a META-INF/services file that conflicts with Infinispan/JDG packaged in the application.
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.