Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

rmi connection problem

Thread view: 
VisionSet - 10 Feb 2006 18:26 GMT
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
hussainak@gmail.com - 10 Feb 2006 19:15 GMT
eloborate
VisionSet - 10 Feb 2006 21:48 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.