File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI connection to registry refused" Watch "RMI connection to registry refused" New topic

RMI connection to registry refused

Eileen Wilson

Joined: Aug 25, 2005
Posts: 1

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

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

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...)

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

Joined: May 13, 2005
Posts: 12

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:

I agree. Here's the link:
subject: RMI connection to registry refused
It's not a secret anymore!