rmi connection problem

V

VisionSet

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
 
V

VisionSet

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top