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