This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Distributed Java and the fly likes Strange problem in RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Strange problem in RMI" Watch "Strange problem in RMI" New topic

Strange problem in RMI

Xin Wu

Joined: Feb 20, 2004
Posts: 1
I meet a strange problem in RMI. My RMI program doesn't work since the server's IP has been changed. The server is never restarted after that change for some reason. Now, I shut down rmiregistry and rebind the remote
object using the new IP. But when I use the new IP on client side, the connection to the server are refused. The strange thing is that: it prompts
it can not connect to the OLD IP address. Here is the information:
D:\test>java -cp d:\test FileClient Server lex0.s
Find the server's object! The mode is :Server
Start to download lex0.s from !
FileClient : Connection refused to host:; nested exception is: Connection refused: connect
java.rmi.ConnectException: Connection refused to host:; nested ex
ception is: Connection refused: connect
server's new IP is 49 and the old one is 211.
I have rebind the server side to new IP : 49
where does it get the old information?
I use ifconfig in my linux server and it also shows the new IP.
Who can help me? Thanks!
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
its bound to be in there somewhere. Did you cahnge both the binding in the server side and the lookup in the client? Do you have a way of searching your entire code for that IP? are you doing a dynamic call to collect the new IP or is it hardcoded? Did you remember to recompile your new code once you changed it? put in println checks at all places where you use the ip to see if you can find where the incorrect IP gets introduced.
Try some of these and se if anything helps.
I agree. Here's the link:
subject: Strange problem in RMI