This is a hack, but you could try setting up a port forwarding on the server, so the registry's server port is exposed in such a way that all requests coming through it look like they're local.
This is fairly easy to do with SSH. On the server, run:
ssh localhost -N -L 1199:localhost:1099 -g
That won't run a command (-N
), but will open a listening socket on port 1199 on the local machine which is forwarded to port 1099 on localhost (-L 1199:localhost:1099
) and which is accessible to connections from any source (-g
). Connections made through this tunnel will appear to the server on port 1099 to have come from localhost. Note that you can also add -f
to have SSH go into the background after setting up the tunnel, in which case i would suggest also adding '-o ExitOnForwardFailure' to improve the error handling.
It should also be possible to do this using netcat rather than SSH, which will be simpler and more efficient, but i don't have a suitable version of netcat installed. It is also possible to do it with socat, if you have that installed:
socat TCP-LISTEN:1199,fork TCP:localhost:1099
Now, i don't know that any of these options will be sufficient. That will open up network-level access, but it's possible that the rmiregistry server will still refuse to register remote objects. I doubt that, though.