1 Reply Latest reply on Oct 9, 2013 4:20 AM by Radoslav Husar

    Using Infinispan's EmbeddedCacheManager with Openshift

    Terry Chia Newbie

      I am trying to use Infinispan as a cache for my Java application hosted with JBoss AS 7 on Openshift.

      I have the following cluster configuration in standalone.xml.

      <cache-container name="cluster" aliases="ha-partition" default-cache="default"> 
        <transport lock-timeout="60000"/> 
        <replicated-cache name="default" mode="SYNC" batching="true" start="EAGER"> 
          <locking isolation="REPEATABLE_READ"/> 
        </replicated-cache>
      </cache-container>
      
      


      I tried accessing the cache with the following code snippet.

      @Resource(lookup = "java:jboss/infinispan/container/cluster") 
      EmbeddedCacheManager container;  
      
      
      private Cache<String, Integer> foo = container.getCache("foo", true);
      
      


      However, a NullPointerException is thrown on the line where with container.getCache. This is presumably because the lookup failed to find a value for container.

      What am I doing wrong?

      http://stackoverflow.com/questions/19220652/using-infinispans-embeddedcachemanager-with-openshift