4 Replies Latest reply on Sep 22, 2016 5:47 AM by Ariel Carrera

    Infinispan subsystem does not work as expected

    Ariel Carrera Newbie

      I tried to configure a new replicated cache in a wildfly node configured with a "full-ha" domain profile but I can't get the cache by a jndi reference.

       

      I am developing with an instance of Wildfly 10.0.0.Final (upgraded to 10.1.0.Final).

       

      I added to infinispan subsytem:

                      <cache-container name="test" default-cache="default" >

                          <transport lock-timeout="60000"/>

                          <replicated-cache name="default" mode="SYNC">

                              <locking isolation="REPEATABLE_READ"/>

                              <transaction mode="BATCH"/>

                              <eviction strategy="LRU" max-entries="10000"/>

                          </replicated-cache>

                      </cache-container>

       

      I added the following lines in my Application Bean:

      @ApplicationScoped

      public class AppConfig {

      @Resource(lookup = "java:jboss/infinispan/cache/test/default") 

      private Cache<String,String> testCache;

       

      @Produces @MyCache

      public Cache<String, String> getCache() {

      return testCache;

        }

      }

       

      But I got the following exception:

      Caused by: javax.naming.NameNotFoundException: infinispan/cache/test/default [Root exception is java.lang.IllegalStateException]

      [Server:server-one]       at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:153)

       

      I looked at the jndi tree and I not found any reference to infinispan.

       

      I tried setting jndi-name, looking for "java:jboss/infinispan/container/test/default",  looking for "java:jboss/infinispan/test/default", looking for CacheContainer "java:jboss/infinispan/cache/test", and setting the mappedName attribute...

       

      Anyone have a working example of this?