Hotrod remote server exception
jacob1111 Sep 13, 2012 3:42 PMHi,
I am trying to use Infinispan remote cache on the remote server. I am using Java application
to connect to the server and store objects in the memory.
When I ran this application for the local hotrod server using loopback address
(127.0.0.1) it works. However, when I try to use it for remote server it fails.
Here is the code snippet:
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
public class HotRodRemoteClient
{
public void start()
{
RemoteCacheManager manager = new RemoteCacheManager("10.100.9.28");
RemoteCache<Integer, Ticket> cache = manager.getCache();
............................................
Here is the exception:
ISPN004017: Could not fetch transport
org.infinispan.client.hotrod.exceptions.TransportException:: Could not connect to server: /10.100.9.28:11222
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.<init>(TcpTransport.java:90)
at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:57)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:254)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.getTransport(TcpTransportFactory.java:145)
at org.infinispan.client.hotrod.impl.operations.FaultTolerantPingOperation.getTransport(FaultTolerantPingOperation.java:44)
at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:67)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.ping(RemoteCacheImpl.java:432)
at org.infinispan.client.hotrod.RemoteCacheManager.ping(RemoteCacheManager.java:538)
at org.infinispan.client.hotrod.RemoteCacheManager.createRemoteCache(RemoteCacheManager.java:520)
at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:452)
at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:447)
at com.packtpub.infinispan.chapter2.HotRodRemoteClient.start(HotRodRemoteClient.java:17)
at com.packtpub.infinispan.chapter2.HotRodRemoteClient.main(HotRodRemoteClient.java:65)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:100)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.<init>(TcpTransport.java:81)
... 13 more
I can ping the server 10.100.9.28:
shell> ping 10.100.9.28
PING 10.100.9.28 (10.100.9.28): 56 data bytes
64 bytes from 10.100.9.28: icmp_seq=0 ttl=64 time=0.261 ms
64 bytes from 10.100.9.28: icmp_seq=1 ttl=64 time=0.184 ms
64 bytes from 10.100.9.28: icmp_seq=2 ttl=64 time=0.290 ms
64 bytes from 10.100.9.28: icmp_seq=3 ttl=64 time=0.285 ms
I use Infinispan 5.1.6, Maven 3.04, JDK6.33.
My hotrod server runs on Centos 5.5, but Java application is on Mac 10.7
Firewalls on both machines are disabled.
I suspect this is configuration problem. What should I change to make it to work?
Thank you,
Jacob Nikom