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

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 14.0.1.Final
    • JCache
    • None

    Description

      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)

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: