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

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • 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)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: