Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help,I will upload my work after handle the problem.

 
Frank Liu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frank Liu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one help?thanks a lot.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try it without the codebase, dynamic downloading, policy file, and security manager. Does it work when your client and server are on the same machine. Does it work when the client and server are on the LAN?
Eugene.
 
Frank Liu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried on the same computer,it worked.Didn't try on the LAN.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you are doing dynamic stub downloading. To isolate the problem, I would package the stubs with the client, remove the references to codebase, policy file, and security manager, and try it again.
Eugene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic