Andrew Thompson wrote:
polaris wrote:
....
Im using RMI to connect java applet with a remote server. The
connection
is successful when the server in same machine or in the same flat
network
but its failed
How? Security exception? sand-box - sign it.
I think the application looks for IP address that inside
the same local network directly. It can't traverse the
internet getways. I got this error from the browser java console:
java.lang.RuntimeException: java.rmi.ConnectException: Connection
refused to host: 222.222.222.222; nested exception is:
java.net.ConnectException: Connection timed out: connect
at ClientApplet.init(ClientApplet.java:29)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.ConnectException: Connection refused to host:
222.222.222.222; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at ClientApplet.init(ClientApplet.java:24)
... 2 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown
Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown
Source)
... 8 more
I replaced the real IP with 222.222.222.222
This sounds like a network problem rather than a Java one. Have you
tried the basic tests, e.g. manually pinging the server?