Trying to RMI set up over public IP on ubuntu but in vain. I have setup http tunneling. RMI server/applet client are successfully running on LAN with ubuntu as RMI server. Over internet, I am able to run server successfully doing registry on 1099 exporting object to fixed port 1100. I have port forwarded both 1099 and 1100 to local IP of ubuntu 192.168.1.XXX. Also I have set the following on rmi server as well as client
[rmiHostName = public ip]
//configuration
System.setProperty("java.security.policy","http://"+rmiHostName+"/basedir/rmi/java.policy");
System.setProperty("java.rmi.server.hostname", rmiHostName);//external ip address
System.setProperty("java.rmi.server.codebase",http://"+rmiHostName+"/basedir/rmi/xxx-xxx-1.0.jar");
However I am getting following exception:
network: Connecting public-ip/cgi-bin/java-rmi.cgi?forward=1099 with proxy=DIRECT
java.rmi.NotBoundException: //public-ip:1099/MyServer
at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:772)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at rmi.source.StellarMessageClient.init(StellarMessageClient.java:99)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Applet initialized
basic: Starting applet
basic: completed perf rollup
basic: Applet made visible
basic: Applet started
basic: Told clients applet is started
Can you guys please help me solve this?