Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Weird problem with rmi

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jason Fritz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!