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 issue 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 issue" Watch "RMI connection issue" New topic

RMI connection issue

Olakunle Oladipo Oni

Joined: Aug 28, 2008
Posts: 18
I've been trying to run an RMI application from the client side but i've not been successful at doing that. The general concept of RMI (distributed application) is that the server side of the application registers a server object with an RMI registry. This happened successfully with my server application. I'm testing the entire application on my local system for now i.e the server and client part all reside on the same computer. I'm connecting both ends of the application by opening two command prompt side by side with the RMI registry console in between them. Syntactically, there are no problems with the programs because both successfully compiled. Infact it's a basic RMI program in which the client program calls a sayHello() method and a greeting message is returned to the client. I have a feeling that the problem is more of external to the code itself i.e. IP referencing by the system an so on. I stuck to the default port of 1099. I followed the required steps (correctly) to get the application running but when it comes to running the client end to connect to the server, i kept receiving this same message. ConnectException.....refused to host:

i followed the directives/advice i got from other forums but the error persisted. The directive i followed include
1 referencing the rmi.server.hostname env variable when running the server program
2 editing the hosts folder under \etc folder to ensure that RMI registry is indeed sticking to the localhost

The same exception persisted. I'll appreciate if someone can assist with effective advice on the way out. The application is being run on windows 7. Both the server and client program are shown below:

The client program:

Olakunle Oni
I agree. Here's the link:
subject: RMI connection issue
It's not a secret anymore!