Wildfly 12 Cache migration error
famaridon Mar 8, 2018 11:05 AMHello,
I'm trying to update wildfly 11 to 12 but I'm getting strange exception with this method CacheContainer#getCache(java.lang.String).
When I call this method I get :
Caused by: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'com/axemble/vdoc/directory/DirectoryManagerBean' has been requested, but no cache configuration exists with that name and no default cache has been set for this container at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:611) at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:598) at org.infinispan.manager.DefaultCacheManager.internalGetCache(DefaultCacheManager.java:462) at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:448) at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:434) at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:60) at com.axemble.commons.cache.DefaultCacheService.getCache(DefaultCacheService.java:98)
I have this cache-container configuration :
<subsystem xmlns="urn:jboss:domain:infinispan:5.0"> <cache-container name="vdoc-cache" default-cache="default"> <local-cache name="default"> </local-cache> </cache-container> </subsystem>
I found a work around by re set the default cache configuration like it :
try { EmbeddedCacheManager embeddedCacheManager = InitialContext.doLookup("java:jboss/infinispan/container/vdoc-cache"); org.infinispan.configuration.cache.Configuration c = new ConfigurationBuilder().clustering().cacheMode(CacheMode.LOCAL).build(); String newCacheName = "default"; embeddedCacheManager.defineConfiguration(newCacheName, c); Cache<String, String> cache = embeddedCacheManager.getCache(newCacheName); // this work } catch (NamingException e) { LOG.error(e); }
It is a bad configuration, bad useage or a bug ?
Cheers!
-
server.log.zip 28.7 KB