title: WildFly 18 update Hibernate to 5.4.12.Final
body: <p>I am trying to update the Hibernate version of my WildFly 18.0.1 server. But I encounter a problem with Infinispan, which is used for caching.
  The classic WildFly distribution hast Hibernate 5.3.13.Final and Infinispan 9.4.16.Final.</p>
  
  <p>In order to update I use the <code>wildfly-server-provisioning-maven-plugin</code> with the following <code>server-provisioning.xml</code>:</p>
  
  <pre><code>&lt;server-provisioning xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:wildfly:server-provisioning:1.2" extract-schemas="true" copy-module-artifacts="true"
                   extract-schemas-groups="org.jboss.as org.wildfly org.wildfly.core org.jboss.metadata"&gt;
  &lt;feature-packs&gt;
      &lt;feature-pack
              groupId="org.hibernate"
              artifactId="hibernate-orm-jbossmodules"
              version="5.4.12.Final" /&gt;
      &lt;feature-pack
              groupId="org.hibernate"
              artifactId="hibernate-search-jbossmodules-orm"
              version="5.10.7.Final" /&gt;
      &lt;feature-pack
              groupId="org.infinispan"
              artifactId="infinispan-feature-pack-client"
              version="10.1.2.Final" /&gt;
      &lt;feature-pack
              groupId="org.infinispan"
              artifactId="infinispan-feature-pack-client"
              version="10.1.2.Final" /&gt;
      &lt;feature-pack
              groupId="org.infinispan"
              artifactId="infinispan-feature-pack-embedded"
              version="10.1.2.Final" /&gt;
      &lt;feature-pack
              groupId="org.infinispan"
              artifactId="infinispan-feature-pack-embedded-query"
              version="10.1.2.Final" /&gt;
      &lt;feature-pack
              groupId="org.infinispan"
              artifactId="infinispan-feature-pack-commons"
              version="10.1.2.Final" /&gt;
      &lt;feature-pack
              groupId="org.infinispan"
              artifactId="infinispan-feature-pack-wf-modules"
              version="10.1.2.Final" /&gt;
      &lt;feature-pack
              groupId="org.hibernate.lucene-jbossmodules"
              artifactId="lucene-jbossmodules"
              version="5.5.5.hibernate06"/&gt;
      &lt;feature-pack
              groupId="org.wildfly"
              artifactId="wildfly-feature-pack"
              version="${wildfly.version}" /&gt;
  &lt;/feature-packs&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have tried different verions like <code>9.4.18.Final</code> or <code>10.0.1.Final</code>. Using the built WildFly with the new versions I get the following exception:</p>
  
  <pre><code>15:40:15,510 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service org.wildfly.clustering.infinispan.cache-container.hibernate: org.jboss.msc.service.StartException in service org.wildfly.clustering.infinispan.cache-container.hibernate: java.lang.NoClassDefFoundError: Failed to link org/infinispan/hibernate/cache/commons/util/SecondLevelCacheMetadataModuleFinder (Module "org.infinispan.hibernate-cache" version 9.4.16.Final from local module loader @5f2108b5 (finder: local module finder @31a5c39e (roots: D:\Dev\Servers\wildfly-hibernate-5.4.11\modules,D:\Dev\Servers\wildfly-hibernate-5.4.11\modules\system\layers\base,D:\Dev\Servers\wildfly-hibernate-5.4.11\modules\system\add-ons\ispn))): org/infinispan/factories/components/ModuleMetadataFileFinder
  at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:70)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
  at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
  at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
  at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
  at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.NoClassDefFoundError: Failed to link org/infinispan/hibernate/cache/commons/util/SecondLevelCacheMetadataModuleFinder (Module "org.infinispan.hibernate-cache" version 9.4.16.Final from local module loader @5f2108b5 (finder: local module finder @31a5c39e (roots: D:\Dev\Servers\wildfly-hibernate-5.4.11\modules,D:\Dev\Servers\wildfly-hibernate-5.4.11\modules\system\layers\base,D:\Dev\Servers\wildfly-hibernate-5.4.11\modules\system\add-ons\ispn))): org/infinispan/factories/components/ModuleMetadataFileFinder
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
  at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:423)
  at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
  at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
  at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
  at org.jboss.modules.Module.loadModuleClass(Module.java:731)
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:348)
  at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
  at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
  at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
  at org.infinispan.commons.util.ServiceFinder.addServices(ServiceFinder.java:63)
  at org.infinispan.commons.util.ServiceFinder.load(ServiceFinder.java:44)
  at org.infinispan.util.ModuleProperties.getModuleMetadataFiles(ModuleProperties.java:47)
  at org.infinispan.factories.GlobalComponentRegistry.&lt;init&gt;(GlobalComponentRegistry.java:107)
  at org.infinispan.manager.DefaultCacheManager.&lt;init&gt;(DefaultCacheManager.java:257)
  at org.jboss.as.clustering.infinispan.subsystem.CacheContainerServiceConfigurator.get(CacheContainerServiceConfigurator.java:100)
  at org.jboss.as.clustering.infinispan.subsystem.CacheContainerServiceConfigurator.get(CacheContainerServiceConfigurator.java:73)
  at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:67)
  ... 8 more
  </code></pre>
  
  <p>How I understand it this exception is thrown because the module <code>org.infinispan.hibernate-cache</code> is missing in the update. Since I could not figure out how to update it, I added the jars manually. If I am using Infinispan <code>10.1.2.Final</code> and add the hibernate-cache module I still get an exception:</p>
  
  <pre><code>15:43:53,638 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service org.wildfly.clustering.infinispan.cache-container.hibernate: org.jboss.msc.service.StartException in service org.wildfly.clustering.infinispan.cache-container.hibernate: org.infinispan.commons.CacheException: Unable to load component metadata!
  at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:70)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
  at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
  at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
  at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
  at java.lang.Thread.run(Thread.java:748)
  Caused by: org.infinispan.commons.CacheException: Unable to load component metadata!
  at org.infinispan.factories.components.ComponentMetadataRepo.initialize(ComponentMetadataRepo.java:175)
  at org.infinispan.factories.GlobalComponentRegistry.&lt;init&gt;(GlobalComponentRegistry.java:107)
  at org.infinispan.manager.DefaultCacheManager.&lt;init&gt;(DefaultCacheManager.java:257)
  at org.jboss.as.clustering.infinispan.subsystem.CacheContainerServiceConfigurator.get(CacheContainerServiceConfigurator.java:100)
  at org.jboss.as.clustering.infinispan.subsystem.CacheContainerServiceConfigurator.get(CacheContainerServiceConfigurator.java:73)
  at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:67)
  ... 8 more
  Caused by: java.lang.NullPointerException
  at org.infinispan.factories.components.ComponentMetadataRepo.readMetadata(ComponentMetadataRepo.java:44)
  at org.infinispan.factories.components.ComponentMetadataRepo.initialize(ComponentMetadataRepo.java:173)
  ... 13 more
  </code></pre>
  
  <p>I am not sure about this exception, but it seems to indicates wrong configuration. I am using the default <code>standalone.xml</code> from WildFly:</p>
  
  <pre><code>    &lt;subsystem xmlns="urn:jboss:domain:infinispan:9.0"&gt;
          &lt;cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan"&gt;
              &lt;local-cache name="passivation"&gt;
                  &lt;locking isolation="REPEATABLE_READ" /&gt;
                  &lt;transaction mode="BATCH" /&gt;
                  &lt;file-store passivation="true" purge="false" /&gt;
              &lt;/local-cache&gt;
              &lt;local-cache name="sso"&gt;
                  &lt;locking isolation="REPEATABLE_READ" /&gt;
                  &lt;transaction mode="BATCH" /&gt;
              &lt;/local-cache&gt;
              &lt;local-cache name="routing" /&gt;
          &lt;/cache-container&gt;
          &lt;cache-container name="server" default-cache="default" module="org.wildfly.clustering.server"&gt;
              &lt;local-cache name="default"&gt;
                  &lt;transaction mode="BATCH" /&gt;
              &lt;/local-cache&gt;
          &lt;/cache-container&gt;
          &lt;cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan"&gt;
              &lt;local-cache name="passivation"&gt;
                  &lt;locking isolation="REPEATABLE_READ" /&gt;
                  &lt;transaction mode="BATCH" /&gt;
                  &lt;file-store passivation="true" purge="false" /&gt;
              &lt;/local-cache&gt;
          &lt;/cache-container&gt;
          &lt;cache-container name="hibernate" module="org.infinispan.hibernate-cache"&gt;
              &lt;local-cache name="entity"&gt;
                  &lt;object-memory size="10000" /&gt;
                  &lt;expiration max-idle="100000" /&gt;
              &lt;/local-cache&gt;
              &lt;local-cache name="local-query"&gt;
                  &lt;object-memory size="10000" /&gt;
                  &lt;expiration max-idle="100000" /&gt;
              &lt;/local-cache&gt;
              &lt;local-cache name="timestamps" /&gt;
          &lt;/cache-container&gt;
      &lt;/subsystem&gt;
  </code></pre>
  
  <p>If there are changes in this configuration schema I was not able to figure out the correct schema to use here.
  To put everything in a nutshell I would like to know which Infinispan version is compatible with the current Hibernate version and what changes I have to do if I have to update Infinispan to <code>10.1.2.Final</code>.</p>