Silent Infinispan Fallback with Invalid Region Factory in Hibernate 6.2.8 on WildFly 32

I’m encountering an issue with Hibernate 6.2.8.Final in a WildFly 32.0.1.Final application, where the second-level (L2) cache is not working as expected with Redisson, and an invalid hibernate.cache.region.factory_class does not throw exceptions.

Setup:

your text Environment: WildFly 32.0.1.Final, Hibernate 6.2.8.Final, Redisson 3.30.1.

Deployment: EAR (prod_cis_ear-5.0.0.ear) with WAR (csc-5.0.0.war).

Dependencies: redisson-hibernate-6-3.30.1.jar, redisson-3.30.1.jar in WEB-INF/lib. Missing snappy-java-1.1.10.5.jar (required for SnappyCodec in redisson.yaml). Configuration:

persistence.xml specifies hibernate.cache.region.factory_class=org.redisson.hibernate.RedissonRegionFactory

redisson.yaml in WEB-INF/classes/ with SnappyCodec.

Spring integration via mpower-data.xml with JNDI datasource (java:/CscDB) and EntityManagerFactory (java:/mpowerCSC).

Logging: TRACE enabled for org.hibernate, org.redisson, org.redisson.hibernate, and org.hibernate.cache.

Issue:

When hibernate.cache.region.factory_class=org.redisson.hibernate.RedissonRegionFactory(invalid), Hibernate does not throw an exception (e.g., ClassNotFoundException or ClassCastException) and silently falls back to Infinispan (org.infinispan.hibernate.cache.v62.InfinispanRegionFactory), as seen in logs: HHH000025: Second-level cache region factory [org.infinispan.hibernate.cache.v62.InfinispanRegionFactory].

When using org.redisson.hibernate.JCacheRegionFactory, the L2 cache still defaults to Infinispan, with no data stored in Redis and no Redisson logs (org.redisson or org.redisson.hibernate).

No exceptions are logged, even though snappy-java-1.1.10.5.jar is missing for SnappyCodec.

Adding hibernate.cache.region.factory_class.strict=true in persistence.xml does not produce errors or change the Infinispan fallback behavior. Expected Behavior:

An invalid region factory class should throw an exception during Hibernate initialization.

org.redisson.hibernate.JCacheRegionFactory should initialize Redisson, store L2 cache data in Redis, and produce relevant logs.

hibernate.cache.region.factory_class.strict=true should enforce the specified region factory. Questions:

Why does Hibernate 6.2.8 silently fall back to Infinispan when an invalid region.factory_class is specified, without logging errors?

What could prevent org.redisson.hibernate.JCacheRegionFactory from initializing in WildFly 32, despite being in WEB-INF/lib and configured in persistence.xml?

Is hibernate.cache.region.factory_class.strict=true supported in Hibernate 6.2.8, and should it throw an exception for initialization failures?

Could WildFly’s classloading or Hibernate module (org.hibernate:main) override persistence.xml settings, causing Infinispan to be used?

Are there specific logging categories or configurations to debug region factory initialization failures? Additional Details: jboss-deployment-structure.xml excludes org.infinispan and org.hibernate.infinispan.

Entities use @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) with unique @SequenceGenerator names.

No Redisson initialization occurs (confirmed via debug bean checking JCacheRegionFactory class and redisson.yaml availability).

Redis server is accessible (redis-cli ping returns PONG).

Any guidance on debugging this issue, ensuring Redisson is used, or configuring Hibernate to throw exceptions for invalid settings would be greatly appreciated. Please let me know if you need specific logs or configuration snippets.

im enabling hibernate l2 cache using redis hibernate version-6.2.13 and wildfly 32 and org.redisson redisson-hibernate-6 3.30.0 org.redisson redisson 3.30.0