Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMI callback when server host has multiple IP addresses

843793Oct 15 2002 — edited Mar 1 2005
I have the TimeServer example from the RMI tutorial working with the Applet running in both Netscape 4.7 and Internet Explorer 6.0. However, I am now trying to run the server on another host which has 2 host names and 2 IP addresses. At first the client reported exception
java.security.AccessControlException: access denied (java.net.SocketPermission <IP2>:1098 connect,resolve)
This occurred because the Applet was downloaded from IP1 but the remote reference returned by the RMI registry contained IP2.

I learned from the RMI FAQ that I could solve this problem by setting the java.rmi.server.hostname property on the server to IP1. This resulted in the remote reference to the TimeServer having the correct address, IP1. Now the Applet can successfully call the TimeServer and register its own remote object. However, there is still a problem when the server makes an RMI call back to the Applet. The client now reports the exception
java.security.AccessControlException: access denied (java.net.SocketPermission <IP2>:1098 accept,resolve)
The exception now occurs on the accept, not the connect.

Why doesn't the server consistently send the client the IP address set by the java.rmi.server.hostname property, IP1? Is there some way to control the IP address that gets sent to the client when the server makes an RMI callback? If not, is there a workaround for this problem?

Richard Myers
Richard.R.Myers@syntegra.com
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2005
Added on Oct 15 2002
52 comments
3,447 views