Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-20-2010, 11:15 PM   PM User | #1
JoolsC
New to the CF scene

 
Join Date: Nov 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
JoolsC is an unknown quantity at this point
Trouble connecting to an RMI server which is behind a router

Let's say the public IP of the router is 92.1.85.179
The local IP of the computer with the server is 192.168.0.2
The router is set to forward 92.1.85.179:5678 to 192.168.0.2:5678

In the server I have:
Code:
System.setProperty( "java.rmi.server.hostname" , "92.1.85.179" );
Registry registry = LocateRegistry.createRegistry( 5678 );
registry.rebind( "TheWebServer" , webServerInt );
The client has:
Code:
Registry registry = LocateRegistry.getRegistry( "92.1.85.179" , 5678 );
server = (WebServerInterface) registry.lookup( "TheWebServer" );
When client is on the network local to the server it's ok. When the client is outside the local network it gets java.rmi.ConnectException: Connection refused to host: 192.168.0.2;

Obviously the server is giving the client the IP of 192.168.0.2 as it doesn't appear in the code, which I thought System.setProperty( "java.rmi.server.hostname" , "92.1.85.179" ); was supposed to change.

Any input would be greatly appreciated.
JoolsC is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:28 AM.


Advertisement
Log in to turn off these ads.