• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Suns rmiregistry returns wrong IP address

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have client/server appl. that uses RMI first I couldn't get it to work with a remote client because I found out that the rmiregistry uses the /etc/hosts file to resolve hostnames to IP address and in my /etc/hosts file there was a line:
127.0.0.2 myhost
Obviously my client couldn't handle this address so I had to change this line to : 10.0.0.151 myhost
That helped, but does anyone know a way to make the rmiregistry return the right IP address without modifying /etc/hosts (e.g. by starting the rmiregistry with a paramater)
Dick
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think its a registry problem. I think its a registration issue in your code. Does your server code look something like this?

You should substitute 10.0.0.151 for myhost. That way it never has to do a lookup at all.
If you are using a dynamic IP tho, that may not work if you ever loose your lease on that IP. There is another way to do it if thats the case, but its kind of a hack way to do it.
Try this first. It should work.
Chris
[ January 20, 2004: Message edited by: Chris Shepherd ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic