That had something to do with jboss setup on my windows machine.
Tested successfully with AS 7.1.1Final in domain mode. Below are the details:
domain.xml entry
<cache-container name="mycachecontainer" default-cache="my-cache" jndi-name="java:jboss/infinispan/mycachecontainer">
<transport lock-timeout="60000"/>
<distributed-cache name="my-cache" owners="2" mode="ASYNC" start="EAGER"/>
</cache-container>
Java code:
private static org.infinispan.manager.EmbeddedCacheManager container = null;
javax.naming.Context context = new javax.naming.InitialContext();
container = (org.infinispan.manager.EmbeddedCacheManager)context.lookup("java:jboss/infinispan/mycachecontainer");
AdvancedCache<Object, Object> cache = container.getCache("my-cache").getAdvancedCache().with(this.getClass().getClassLoader());
System.out.println("Reading the cache firstName from cache: " + cache.get("firstName"));
System.out.println("updating the cache...");
cache.put("firstName", requestMap.get("firstName"));
System.out.println("cache updated.");
System.out.println("Reading the cache - firstName" + cache.get("firstName"));
Paul thanks for your pointer on the start="EAGER" attribute, I actualled faced that issue yesterday due to lazy initialization nature of the infinispan cache.