I sent the server.jar to my friend,and I want to connect the client to the server via Internet.
but I failed.
I use this to connect:
ServerInterface myServerObject = (ServerInterface) Naming.lookup("rmi://61.171.20.38/remoteData");
and get this Exception:
java.rmi.ConnectException: Connection refused to host: 10.123.123.199; nested exception is:
java.net.ConnectException: Connection timed out: connect
Why the host change to 10.123.123.199,I don't what it is.
I used "telnet 61.171.20.38 1099" to see if the server is up.It's ok.
The server command line is
java -jar -Djava.rmi.server.codebase=file:/e:\java\server.jar server.jar 61.171.20.38 .
The server use this to bind itself:
Naming.rebind("rmi://61.171.20.38/remoteData", new Server());
Are there any thing wrong.
I also tried add -Djava.security.policy=Server.policy
,but failed either.