aspose file tools*
The moose likes Distributed Java and the fly likes RMI connection to registry refused 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 » Java » Distributed Java
Bookmark "RMI connection to registry refused" Watch "RMI connection to registry refused" New topic
Author

RMI connection to registry refused

Eileen Wilson
Greenhorn

Joined: Aug 25, 2005
Posts: 1
Hi,

I'm having issues getting my rmi server to connect to the registry this the the code:



And this is the exception trace:



I do have a firewall running however I have switched it off and the exception remains the same.

I've tried each of the following: my own static IP address, localhost and 127.0.0.1

I'm starting the registry with the following .bat file




I'd appreciate any suggestions,
Many thanks
[ August 25, 2005: Message edited by: Eileen Wilson ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Nothing wrong is jumping out at me from what you've posted so far...

Just to make sure, when you run your batch file - a new blank command prompt window pops up and stays up for rmiregistry, right?

Are you setting the "java.rmi.server.hostname" property on your server to see if this fixes the problem you are having, or have you always been setting it? I'd leave it off... I don't see a need to explicitly set it. You'd only need to set this property if you were trying to get around a NAT firewall or something - (as referred to in this post on Sun's forums...)


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Sudha Rams
Greenhorn

Joined: May 13, 2005
Posts: 12
Hello,

I too agree with Nathan. I'm a newbie to RMI and I had a similar piece of code working okay.

Just a suggestion: Using localhost works fine only in the same physical host. I had to give the IP address when I executed the client from a different machine from that of the server.

I've given below the details of the batch files that I use:

Here is how I start the registry:



I start the RMI service like this:



I execute the RMI client like this:

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RMI connection to registry refused