I have two RMI apps that run only on the local host. Call them the client and server--the server starts up the RMI registry, but otherwise they are pretty much the same, sending messages to each other. These apps have worked fine for years but there are issues when you change networks...for example, if you are on a laptop and you go from home to work. If the two apps have already been started, they can no longer communicate with each other after the network change. Neither client nor server can send messages to each other.
to both apps. Now I can communicate between server and client after the network change, but not the other way: that results in a timeout.
I have reason to believe this is an Apple JVM issue. It happens with both 1.5 and 1.6 (1.6.0_17) under Leopard, however, it does not happen using the latest SoyLatte (1.0.3) jvm. Under SoyLatte, the first RMI method call after the network change takes about 45 seconds, but after that, it works fine. Unfortunately, using the SoyLatte JVM is not a practical workaround for me for a variety of reasons.
However, after the network change, I see this in the client console:
java.rmi.ConnectException: Connection refused to host: 10.10.6.101; nested exception is:
java.net.ConnectException: Operation timed out
It looks like RMI "forgets" that it is supposed to use 127.0.0.1, and goes back to the IP that was assigned to the machine when the RMI connection was initially made.
Of course, that IP has changed since the computer is now on a different network.
Supposedly, setting the java.rmi.server.hostname property is supposed to prohibit this behavior, but it looks like that doesn't work consistently.
Can anyone shed any light on this?
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden