E
elh.maayan
hi ...
i created a small RMI Server this this setup code:
public static void main(String[] args) {
try {
LocateRegistry.createRegistry(2001) ;
final Compute engine = new ComputeImpl();
Naming.rebind("//localhost:2001/Compute",engine);
System.out.println("ComputeEngine bound");
} catch (Exception e) {
e.printStackTrace();
}
}
i'm sending to this server an object which extends
UnicastRemoteObject.
when the server and the client reside on the same machine, all goes
well.
however when the server is on a unix machine and the client is on a pc
i get:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is:
java.rmi.ConnectIOException: Exception creating connection to:
172.30.104.23; nested exception is:
java.net.SocketException: Connection timed out:could be due to
invalid address
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:
340)
at sun.rmi.transport.Transport$1.run(Transport.java:168)
at java.security.AccessController.doPrivileged(AccessController.java:
279)
at sun.rmi.transport.Transport.serviceCall(Transport.java:164)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:506)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest
(TCPTransport.java:838)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:912)
at java.lang.Thread.run(Thread.java:810)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall
(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod
(RemoteObjectInvocationHandler.java:179)
at java.rmi.server.RemoteObjectInvocationHandler.invoke
(RemoteObjectInvocationHandler.java:132)
at $Proxy0.invoke(Unknown Source)
at com.pnx.rmi.client.CallerClient.main(CallerClient.java:14)
Caused by: java.rmi.ConnectIOException: Exception creating connection
to: 172.30.104.23; nested exception is:
java.net.SocketException: Connection timed out:could be due to
invalid address
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:603)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:
204)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:
190)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:109)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(
when the 172.30.104.23 is actually the PC's address (not the
server's)
the 2nd issue is that it takes a long long time for me to actually get
the exception, (about a minute)
all this will not happen if the object being transfered will not
extend UniicaseRemoteObject, but rather implements Serliazble
what's going on?
i created a small RMI Server this this setup code:
public static void main(String[] args) {
try {
LocateRegistry.createRegistry(2001) ;
final Compute engine = new ComputeImpl();
Naming.rebind("//localhost:2001/Compute",engine);
System.out.println("ComputeEngine bound");
} catch (Exception e) {
e.printStackTrace();
}
}
i'm sending to this server an object which extends
UnicastRemoteObject.
when the server and the client reside on the same machine, all goes
well.
however when the server is on a unix machine and the client is on a pc
i get:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is:
java.rmi.ConnectIOException: Exception creating connection to:
172.30.104.23; nested exception is:
java.net.SocketException: Connection timed out:could be due to
invalid address
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:
340)
at sun.rmi.transport.Transport$1.run(Transport.java:168)
at java.security.AccessController.doPrivileged(AccessController.java:
279)
at sun.rmi.transport.Transport.serviceCall(Transport.java:164)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:506)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest
(TCPTransport.java:838)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:912)
at java.lang.Thread.run(Thread.java:810)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall
(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod
(RemoteObjectInvocationHandler.java:179)
at java.rmi.server.RemoteObjectInvocationHandler.invoke
(RemoteObjectInvocationHandler.java:132)
at $Proxy0.invoke(Unknown Source)
at com.pnx.rmi.client.CallerClient.main(CallerClient.java:14)
Caused by: java.rmi.ConnectIOException: Exception creating connection
to: 172.30.104.23; nested exception is:
java.net.SocketException: Connection timed out:could be due to
invalid address
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:603)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:
204)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:
190)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:109)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(
when the 172.30.104.23 is actually the PC's address (not the
server's)
the 2nd issue is that it takes a long long time for me to actually get
the exception, (about a minute)
all this will not happen if the object being transfered will not
extend UniicaseRemoteObject, but rather implements Serliazble
what's going on?