I'm doing this:
(RemoteServerService) Naming.lookup(
"rmi://" + host + ":"
+ port + "/" + RemoteServerImpl.SERVICE_NAME));
and that goes through ok with no exceptions
but when I actually call a remote method I get a:
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1;
nes
ted exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
at
java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Remo
teObjectInvocationHandler.java:179)
at
java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvo
cationHandler.java:132)
at $Proxy0.login(Unknown Source)
at
myfoo.server.RemoteServerAdapter.login(RemoteServerAdapter.java:87
)
Why is the host given as localhost and not the host I do Naming.lookup under
What can I do to trace the problem?
TIA
--
Mike W
I don't know what else I could say to make it any clearer.
Anyhow I've solved it calling:
System.setProperty("java.rmi.server.hostname", "xxx.xxx.xxx.xxx");
on the server.
--
Mike W