This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes need help (urgent)!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "need help (urgent)!!!" Watch "need help (urgent)!!!" New topic

need help (urgent)!!!

macello java

Joined: Mar 07, 2002
Posts: 2
hi, guys,
I have got a strange problem.
I use -Djava.rmi.server.hostname= as a property to start my RMI server. In my DBServer class, I use following sentences:
String hostname = System.getProperty("java.rmi.server.hostname");
Naming.rebind("rmi://"+hostName+":1099/Server", dbServer);
In my client side, I use:
} to find the remote object.
The problem is when I enter the IP address of the sever, eg,, it works well; but when I enter, it still works. If I enter, it doesn't work; if I enter 127, 127.0, 127.0.0, and, it doesn't work. It seems that when RMI looking for the reference of the remote object, it ignores the last two digit of the IP address.
Please help to fix it. I will take the exam at the beginning of next month.
Thanks a lot!
Laudney Ren
Ranch Hand

Joined: Jan 06, 2002
Posts: 111
127.*.*.* is loop address. But normally, only is considered to be the "genuine" loop address.
As for your test: 256 is invalid. 255 is for broadcast. You may use any number >0 and <255
127, 127.0, 127.0.0 are invalid IP addresses. should work. If not, try to change it into If works, then the last number can't be 0.
BTW, I don't think what you are experiencing is required in the project.
-- Laudney

" Veni, vidi, vici "<br />" I came, I saw, I conquered "
I agree. Here's the link:
subject: need help (urgent)!!!
Similar Threads
invoke EJB on a remote machine with dynamic IP
about the rmi
RMI callback
RMI app behind NAT firewall
RMI Server Configuration