Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14255

Creating new cache through JCache API throws exception when configuration is defined on internal CacheManager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 14.0.1.Final
    • JCache
    • 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)

       

              Unassigned Unassigned
              rudlig Piotr Wolny (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: