RMI on IPv4 and IPv6
843793Sep 2 2004 — edited Sep 13 2004Has anyone been able to get an RMI object to work on ipv6 and ipv4 at the same time? I have a server, 'middle' which runs ipv4 and ipv6. When I start up my RMI server on 'middle', the object binds into the registry and advertises the address "192.168.1.136" in the UnicastRef.
When I jump onto my ipv4-only Windows box, I can access the object just fine. When I switch to my ipv6-only Linux box (not running anything ipv4!), the RMI client application is able to retrieve theRMI Server object from the registry on 'middle', but any subsequent invokation on that RemoteRef fail, because the Remote Reference that 'middle' returned said that the address is "192.168.1.136". I was able to verify this behavior using an ethernet sniffer (tcpdump) on 'middle'.
I switched things around and ran the RMI Server on the ipv6-only box, and then ran the client on 'middle' and it all worked fine. Since the RMI Server had started on the ipv6-only server, the only available IP address was the ipv6 address. Thus, when the RMI client running on 'middle' retrieved the RemoteRef from the ipv6-only box, the RemoteRef contained the ipv6 address.
It turns out that the RemoteRef used by the JVM is implemented by sun.rmi.server.UnicastRef, which contains a sun.rmi.transport.LiveRef, which only seems to contain a single instance of sun.rmi.transport.tcp.TCPEndpoint, which contains a single String containing the one-and-only host.
So, it seems to me that a single remote object cannot be served up to IPv4 and IPv6, regardless of whether I use the Registry or Activation, the RemoteRef used by Sun only allows a single endpoint, or am I missing something (hopefully!)