4 Replies Latest reply on Feb 4, 2014 2:32 AM by nadirx

    infinispan treecache API support RemoteCache?

    sanyueniao

      Hi

         When I used treecache API,I got an Error.

       

      my code :

           CacheContainer cacheContainer = new RemoteCacheManager("127.0.0.1", 11222);

           Cache<String, String> cache = cacheContainer.getCache();

           TreeCacheFactory fac = new TreeCacheFactory();

           TreeCache<String, String> createTreeCache = fac.createTreeCache(cache);

           createTreeCache.put("a", "B" ,"c");

       

      when runing to :TreeCache<String, String> createTreeCache = fac.createTreeCache(cache); program throw an Exception:

       

      Exception in thread "main" java.lang.UnsupportedOperationException

              at org.infinispan.client.hotrod.impl.RemoteCacheSupport.getConfiguration(RemoteCacheSupport.java:118)

              at org.infinispan.tree.TreeCacheFactory.createTreeCache(TreeCacheFactory.java:54)

              at com.foundersc.xp.infinispan.infispantest.main(infispantest.java:45)

       

      what's wrong in my code, can any one give me advice?  thanks a lot.

       

       

       

      my configration follow :

       

      <?xml version="1.0" encoding="UTF-8"?>

      <infinispan

            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"

            xmlns="urn:infinispan:config:5.1">

          <global>

             <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"

                clusterName="infinispan-cluster"

                distributedSyncTimeout="50000">

                <properties>

                   <property name="configurationFile" value="jgroups-tcp.xml"/>

                </properties>

             </transport>

          </global>

          <default>

             <!-- Configure a synchronous replication cache -->

             <invocationBatching enabled="true" />

             <clustering mode="distribution">

                <async/>

                 <l1 enabled="true" lifespan="10000"/>

                 <hash numOwners="2" rehashWait="5000" rehashRpcTimeout="10000" />

             </clustering>

          </default>

          <namedCache name="MFDAYCACHE">

             <eviction wakeUpInterval="500" maxEntries="50000" strategy="FIFO" />

          </namedCache>

      </infinispan>