Hi,
I have the following code in eclipse and am trying to run this simple test. When I do I get this error:
Exception in thread "main" java.lang.NoSuchMethodError: org.infinispan.util.SysPropertyActions.setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
at org.infinispan.client.hotrod.RemoteCacheManager.start(RemoteCacheManager.java:458)
at org.infinispan.client.hotrod.RemoteCacheManager.<init>(RemoteCacheManager.java:349)
at org.infinispan.client.hotrod.RemoteCacheManager.<init>(RemoteCacheManager.java:363)
at org.infinispan.client.hotrod.RemoteCacheManager.<init>(RemoteCacheManager.java:356)
at Quickstart.main(Quickstart.java:15)
Line 15 in my Quickstart.java file is: RemoteCacheManager cacheContainer = new RemoteCacheManager("localhost:11223");
I'm using infinispan 5.1.5, on Ubuntu Linux and have two infinispan servers on two different vms spun up and awaiting this connection (at least they started without errors...)
Any advice greatly appreciated...
Code follows:
import java.util.Map;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.client.hotrod.ServerStatistics;
public class Quickstart {
public static void main(String[] args) {
RemoteCacheManager cacheContainer = new RemoteCacheManager("localhost:11223"); //(This is line 15 in code)
//obtain a handle to the remote default cache
@SuppressWarnings("rawtypes")
RemoteCache cache = cacheContainer.getCache("myCache");
//now add something to the cache and make sure it is there
cache.put("car", "ferrari");
if(cache.get("car").equals("ferrari")){
System.out.println("Found");
} else {
System.out.println("Not found!");
}
//remove the data
//cache.remove("car");
//Print cache statistics
ServerStatistics stats = cache.stats();
for (Map.Entry stat : stats.getStatsMap().entrySet()) {
System.out.println(stat.getKey() + " : " + stat.getValue());
}
// Print Cache properties
System.out.println(cacheContainer.getProperties());
cacheContainer.stop();
}
}