UnknownHostException for server java
Posted
by nilesh
on Stack Overflow
See other posts from Stack Overflow
or by nilesh
Published on 2009-09-07T12:00:56Z
Indexed on
2010/05/16
8:10 UTC
Read the original article
Hit count: 308
I am not able to connect to an remote known server through Java code; the exception while connecting is java.net.NoRouteToHostException: No route to host.
But strangely, I am able to connect to same server through ssh.
Details: Simple Java client when tries to establish connection with Java standalone server, while conneting the exception occurs at following statement:
Socket socket = new Socket(ServerIP ServerPort);
The port needed is open on server so that externally request can come in.
Again the following is returns false
InetAddress.getByName(SERVER_IP).isReachable(1000)
The Server is running on Fedora, Java 5.
FYI: Java cannot resolve DNS address from AIX: UnknownHostException is almost same to my question, but somehow this is not AIX related; moreover I feel the issue to be more of Network or firewall issue.
Please guide me.
© Stack Overflow or respective owner