-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
14.0.1.Final
-
None
Creating new cache through JCache API throws exception when configuration is defined on internal CacheManager.
Following code:
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(); EmbeddedCacheManager embeddedCacheManager = cacheManager.unwrap(EmbeddedCacheManager.class); embeddedCacheManager.defineConfiguration("test", new ConfigurationBuilder().build()); cacheManager.createCache("test", new MutableConfiguration<>());
throws:
Exception in thread "main" org.infinispan.commons.CacheConfigurationException: ISPN000453: Attempt to define configuration for cache test which already exists at org.infinispan.manager.DefaultCacheManager.doDefineConfiguration(DefaultCacheManager.java:451) at org.infinispan.manager.DefaultCacheManager.defineConfiguration(DefaultCacheManager.java:423) at org.infinispan.jcache.embedded.JCacheManager.create(JCacheManager.java:211) at org.infinispan.jcache.AbstractJCacheManager.createCache(AbstractJCacheManager.java:93) at com.github.gildur.infinispan.InfinispanJCache.main(InfinispanJCache.java:16)