Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI app - java.rmi.ConnectException  RSS feed

 
Lukas Stephienn
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I built an app based on RMI. Client (which is applet) connects to a server and sends it's own stub so the server could also invoke client methods.

Everything works fine as long as client machine has public IP.
But when he has not:

java.rmi.ConnectException: Connection refused to host: <here is client IP>;
nested exception is: java.net.ConnectException: Connection timed out
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94) ...

This exception occurs when server for the first time tries to invoke remote method of the client.

Is there any solution for this problem?
Thanks in advance.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun's RMI FAQ has a section on workarounds for firewalls.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!