hi,
i'm trying to use infinispan but when i'm running twice my program i have a suspected member exception.
I'm doing it :
1) i'm running the program => P1
2) i'm running it again => P2
3) in P1 i'm writing a=>b
4) before the end of the a=>b command i'm closing P1 ('q')
here is the code :
public
class InfiniSpanDemo {
public
static
void main(String[] args)
throws NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException,
HeuristicMixedException, HeuristicRollbackException, IOException {
hello();
}
public
static
void hello()
throws NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException,
HeuristicMixedException, HeuristicRollbackException, IOException {
CacheManager mgr =
new DefaultCacheManager(InfiniSpanDemo.class.getResourceAsStream("/config/infinispan-config.xml"));
Cache<String, String> cache = mgr.getCache("distributedCache");
do {
System.out.println("type
'key=>value' to set a value or 'key?' to read a value to test a value or 'q' to quit\n");
Scanner in =
new Scanner(System.in);
String action = in.nextLine();
if (action.equalsIgnoreCase("q"))
{
break;
}
else
if (action.contains("=>"))
{
String[] s = action.split("=>");
cache.put(s[0], s[1]);
for (int
i = 0; i < 1000000; i++) {
cache.put(i +
"-" + s[0], i +
"_" + s[1]);
}
}
else
if (action.length() > 1 && action.charAt(action.length() - 1) ==
'?') {
String s =action.substring(0, action.length() - 1);
System.out.println(cache.get(s));
}
else {
System.out.println("retry");
}
}
while(true);
cache.stop();
mgr.stop();
}
}
and here the exception:
GRAVE: Execution error:
org.infinispan.remoting.transport.jgroups.SuspectException: Suspected member: Jalapeno-25790
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:419)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:100)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:124)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:229)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:216)
at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:199)
at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:192)
at org.infinispan.interceptors.ReplicationInterceptor.handleCrudMethod(ReplicationInterceptor.java:114)
at org.infinispan.interceptors.ReplicationInterceptor.visitPutKeyValueCommand(ReplicationInterceptor.java:78)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.LockingInterceptor.visitPutKeyValueCommand(LockingInterceptor.java:198)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:183)
at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:132)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:58)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:39)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:271)
at org.infinispan.CacheDelegate.put(CacheDelegate.java:411)
at org.infinispan.CacheSupport.put(CacheSupport.java:28)
at pack.InfiniSpanDemo.hello(InfiniSpanDemo.java:36)