aspose file tools
The moose likes Distributed Java and the fly likes RMI app - java.rmi.ConnectException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "RMI app - java.rmi.ConnectException" Watch "RMI app - java.rmi.ConnectException" New topic
Author

RMI app - java.rmi.ConnectException

Lukas Stephienn
Ranch Hand

Joined: Dec 23, 2005
Posts: 60
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.


SCJP 5.0 (91%), SCBCD 1.3 (94%), SCWCD 1.4 (88%)
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Sun's RMI FAQ has a section on workarounds for firewalls.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI app - java.rmi.ConnectException
 
Similar Threads
RMI timeout configuration
RMI Exception
rmi--about socket factory
running a rmi sample
Urgent help on ConnectException required..