GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Weird problem with rmi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Weird problem with rmi" Watch "Weird problem with rmi" New topic
Author

Weird problem with rmi

Jason Fritz
Greenhorn

Joined: Jun 07, 2006
Posts: 4
Hi,

I was performing some test in the B&S assignment and I came up with a problem with the client/server (based on RMI) that I'm not able to solve.

All the development has been made on a linux computer with JDK 1.4.2. The network testing is done using the same linux-based machine and a WindowsXP-based machine using JRE 1.5.0_06.

In the first scenario, server is run in the windows machine and client in the linux machine and everything works perfectly.
However, when I use a second scenario, i.e. the server running on the linux-machine and the client running in the Windows machine a weird problem occurs:

The client cannot connect to the server and a UnmarshallException occurs. Moreover, it says that the client is trying to connect to localhost (127.0.0.1) instead to the given IP (passed to the Naming.lookup() function).

To be honest I'm totally lost with this problem since it seems to work in one direction but not in the other direction. So any advice/guidance will be very welcome.

Thanks in advance,
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Had the same problem with Linux initially.
It's caused by many Linux distributions putting a hard reference to 127.0.0.1 as localhost in the /etc/hosts file.
Comment out that entry and restart the server, all should be well.


42
Jason Fritz
Greenhorn

Joined: Jun 07, 2006
Posts: 4
Thanks a lot,

In fact I was tinking in the same direction as your solution (linux distribution was ubuntu - so debian based), because the same compiled code was working properly when connecting two windows based machines and also on a mac (with os 10.4). So I was guessing that it had something to do with the name resolution.

As said, thanks for your answer.
Saheed Adepoju
Ranch Hand

Joined: Jun 23, 2004
Posts: 267
Hi
Just a thought, i figured using 1.4.2 is actually kinda late cause it has been 18 months since its realease. Shoudnt you be testing/working with Jdk 5.0 or is simply using the JRE(1.5) enough. Anyways just an observation


Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
 
GeeCON Prague 2014
 
subject: Weird problem with rmi