Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rmi connection problem

2 views
Skip to first unread message

VisionSet

unread,
Feb 10, 2006, 1:26:28 PM2/10/06
to

Ok the host is slighty suspect as in I'm not sure I can access it.
But I've been told I can.
I can run 'telnet host port' without an access denied
I just want to make sure there's nothing in my code stopping this.

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


huss...@gmail.com

unread,
Feb 10, 2006, 2:15:17 PM2/10/06
to
eloborate

VisionSet

unread,
Feb 10, 2006, 4:49:35 PM2/10/06
to

<huss...@gmail.com> wrote in message
news:1139598916....@g14g2000cwa.googlegroups.com...
> eloborate

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


0 new messages