my dog learned polymorphism*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes java.rmi.ConnectException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "java.rmi.ConnectException" Watch "java.rmi.ConnectException" New topic
Author

java.rmi.ConnectException

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi Guys
I am getting this exception when I try to execute my application in network mode. My solution is based on RMI approach. Following is the exception

What may be the reason ?
Thanks in advance
Ravi


SCJP, SCJD, SCWCD, SCBCD, SCEA
Brian Blignaut
Ranch Hand

Joined: Jan 08, 2003
Posts: 61
I had a similar problem, try add the following line to the command line that starts your server.
-Djava.rmi.server.hostname=localhost.localdomain
Hope it helps
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi Brian
I tried it but I am still getting the error

Ravi
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi Brian
I had not started rmiregistry and hence the above error when I started the server. The problem however remains when the client tries to communicate with the server, I still get the exception, this is after I started the server as per the command suggested by you which is also shown above.

Thanks
Ravi
Brian Blignaut
Ranch Hand

Joined: Jan 08, 2003
Posts: 61
Ok, well remove the line then, do you not have an entry for localhost in your hosts file? I had the problem on my laptop, which is configured for our company network.When I was not connected to the network it kept trying to connect to the company IP instead of the local host.
Arsh Sekhon
Greenhorn

Joined: Dec 16, 2004
Posts: 1
Thanks a lot for posting this comment. It worked for me.


Great work
 
wood burning stoves
 
subject: java.rmi.ConnectException