File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Help on locate RMI registry in linux and window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Help on locate RMI registry in linux and window" Watch "Help on locate RMI registry in linux and window" New topic
Author

Help on locate RMI registry in linux and window

lambertlee Li
Ranch Hand

Joined: Dec 15, 2005
Posts: 52
Hi there,

I just tested my application both in windows and linux machine.

I found a weired issue with my application(testing client running in remote mode):

(1)if I run my server in windows machine, client in linux machine. everything is fine. Client got connected, I could book/unbook etc.
(2)if I run my server in linux machine, client run in window machine, my client GUI couldn't connect to server, and I got the following exception:


"172.30.16.225" is my linux box IP.

My RMI registry look up I use this:


Just not understand why application only work fine one way. Window couldn't look up that registry in linux box. But linux box actually get locate the registry in window box. Does anyone ever encounter this problem?
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Add logging in the server, see what that does.
You may have a problem in your serverside network configuration (outside your server or client code).
Many Linux machines for example have their hosts file set up to incorrectly define the loopback interface, causing the server to send back an incorrect ip address for the stub to the client, with the result that the stub can't talk to the server after being returned from it.


42
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi

I encounter a similar problem, but in my case the linux machine has a firewall. A very restrictive one, I just switch it off and it works.

regards M


SCJP, SCJD, SCWCD, OCPJBCD
lambertlee Li
Ranch Hand

Joined: Dec 15, 2005
Posts: 52
Hi Jeroen, It seems you are right. My linux box firewall was disabled. my client side sometimes catch exception like:



regardless I passed in my correct server IP address on
code:

But how can I fixed that network configuration on linux box? Do you have any idea where those host files sitting on in linux? Or maybe I could just ignore it as it seems it is the machine configuration problem as my codes works fine for the case of (client in linux, server in windows). Just scared that may lead to auto failure if accessor happen to encountered such an issue like this.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
It's most likely in /etc
If 127.0.0.1 is mapped to more than just localhost remove every other entry it had for that address.
I think that's enough, though you might have to remove the entire line for 127.0.0.1.
Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
i guess you are digging too much into the requirements. Not discouraging you from testing nice scenarios but then this multi platform testing is not necessary for the Test i believe.


-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
It's not about multiplatform testing but testing the scenario where the server runs on a different machine from the client.
You do want them to talk together in that scenario and in this case the machine on which the server runs is configured incorrectly.

Some people are here to learn something...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help on locate RMI registry in linux and window
 
Similar Threads
ConnectException
JDK 1.3.1_01 on Windows XP RMI Problem
java.rmi.ConnectException
Java RMI Connection Problem
java.rmi.ConnectException while system testing