1 Reply Latest reply on Oct 9, 2017 3:59 AM by Tristan Tarrant

    Infinispan 9.1.1 Final - AdminFlag.PERSISTENT not working

    Jeet Bavishi Newbie

      Hi,

       

      I am using infinispan 9.1.1-Final in a server-client architecture with caches configured as distributed caches. I am trying to create a new, non-existent cache through programming. It is getting created but the new cache is not being added in xml configuration and it does not show up on the web console. So I found out that if I use the  Admin flag PERSISTENT, I can persist the configurations. But it is not working for me. Following is the code I am using:

       

      ConfigurationBuilder configBuilder = new ConfigurationBuilder();

      configBuilder.addServers("local.com").maxRetries(3);

      configBuilder.nearCache().mode(NearCacheMode.INVALIDATED).maxEntries(-1);

      configBuilder.socketTimeout(1800);

      configBuilder.tcpKeepAlive(true);

      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configBuilder.build());

      EnumSet<AdminFlag> enumSet = EnumSet.allOf(AdminFlag.PERSISTENT);

      remoteCacheManager.administration().createCache("myCache", "Template", enumSet);

       

      Following is the exception I am getting:

       

      WARN: ISPN004005: Error received from the server: java.util.concurrent.ExecutionException: org.infinispan.commons.CacheException: java.lang.IllegalArgumentException: No enum constant org.infinispan.server.core.admin.AdminFlag.persistent

      org.infinispan.commons.CacheException: java.lang.IllegalArgumentException: No enum constant org.infinispan.server.core.admin.AdminFlag.persistent

      java.lang.IllegalArgumentException: No enum constant org.infinispan.server.core.admin.AdminFlag.persistent

      Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=2 returned server error (status=0x85): java.util.concurrent.ExecutionException: org.infinispan.commons.CacheException: java.lang.IllegalArgumentException: No enum constant org.infinispan.server.core.admin.AdminFlag.persistent

      org.infinispan.commons.CacheException: java.lang.IllegalArgumentException: No enum constant org.infinispan.server.core.admin.AdminFlag.persistent

      java.lang.IllegalArgumentException: No enum constant org.infinispan.server.core.admin.AdminFlag.persistent

      at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:363)

      at org.infinispan.client.hotrod.impl.protocol.Codec20.readPartialHeader(Codec20.java:152)

      at org.infinispan.client.hotrod.impl.protocol.Codec20.readHeader(Codec20.java:138)

      at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:60)

      at org.infinispan.client.hotrod.impl.operations.ExecuteOperation.executeOperation(ExecuteOperation.java:50)

      at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:56)

      at org.infinispan.client.hotrod.impl.RemoteCacheManagerAdminImpl.createCache(RemoteCacheManagerAdminImpl.java:41)

      at root.BlogController.<init>(BlogController.java:59)

      at root.BlogController.main(BlogController.java:35)

       

      Please let me know what can I do to make it work as this is a very important feature that we require.

       

      Let me know ASAP