The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Naming.lookup() strange behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Naming.lookup() strange behavior" Watch "Naming.lookup() strange behavior" New topic
Author

Naming.lookup() strange behavior

Richard Everhart
Ranch Hand

Joined: Nov 19, 2003
Posts: 54
Okay, this is strange to me but perhaps not to you.

I've started the RMI registry on my computer doing the following:



I then try to start the client by doing this:



The client connects with the registry fine when I enter 127.0.0.1, and the name of the machine itself. It also reacts appropriately when the user has entered an incorrect host name or IP address. However, if remoteHost is the string 'qwerty127.0.0.1' or '127.0.0.1qwerty' or '127.a.0.0.1' or even empty string it works. It doesn't work, though, when I enter some junk string like just 'qwerty' or if remoteHost is some variation of the loopback IP like 127.1.0.1.

It seems that somehow by default, when the remote host is specified a certain way, the localhost is contacted to obtain the remote object. I still have not tried out my code anywhere else except my computer so I'm not sure if I'll have different behavior doing this or not.

Thanks!

Rich
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 10820
    
  25

Hi Rich,

I don't think that you need to worry about for your assignment. This sounds like a JVM / RMI implementation issue, and it is really out of your hands.

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Naming.lookup() strange behavior
 
Similar Threads
NX: network client access
Why does RMI naming lookup work on the local host when I give it a garbage name?
Sun's RMI Tutorial
RMI Binding on localhost
need help (urgent)!!!