• Register
0 votes
79 views

Problem :

Getting bellow error
java.net.connectexception connection timed out no further information
6 5 3
6,930 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

1) Firstly try to ping the destination host, if the host is pingable it means client and server machine are in the same network.

2)Try to connect to the server host and port using telnet. If you are able to connect it means something is wrong with your client code. Also, by observing telnet output you will come to know whether the server is running or not or server is disconnecting the connection.

3)For a quick fix catch ConnectException in your main try-catch block like bellow:

try {
    // connect, write, and read ...
} catch (ConnectException ce) {  
    System.out.println("You caught a ConnectException.");
} catch (IOException e1) {       
    // TODO Auto-generated catch block
    e1.printStackTrace();
} finally {
9 7 4
38,600 points
0 votes

Connect is the most common networking exception in java. This error encounter when you are working with client-side architecture and trying to establish a TCP connection from the client to the server.

Reasons:

This is a clear case that client is trying to connect to TCP port but not able to successfully establish. Here are some couple of reasons;

Client and server, either or both are not in-network:

This is possible that both the client and server are not connected to LAN or the internet or any other network.

The server is not running:

The second most common reason is that the server is down. In this case, you also get error java.net.ConnectException. Connection refused error.

The server is not listing to port:

One reason of encounter this error is that the server is running but not listing to any port. It is very hard to figure out this case until you think about it and verify the connection.

Solution:

First, try to a ping destination host, if the host is pingable then it means that client and server machines are pingable.

Try to connect to the server host and port by using telnet. If you can connect then it means that something is wrong with your client mode. By observing telnet output you will come to know that the server is running or not and the server is disconnecting the connection.

I hope this will help to solve your problem.

11 5 2
3,890 points

Related questions

0 votes
1 answer 52 views
52 views
Problem : I am getting bellow error java.net.connectexception: connection refused: no further information:
asked Oct 31, 2019 peterlaw 6.9k points
0 votes
2 answers 347 views
347 views
Problem : Today I was testing Server and Client code on different machine. Both were on same Wi-fi network. I created clients and got this exception for many threads : java.net.ConnectException: Connection timed out: no further information
asked Oct 23, 2019 peterlaw 6.9k points
0 votes
1 answer 7 views
7 views
Solve this.
asked Dec 26, 2020 TeamScript 9.3k points
0 votes
1 answer 3 views
3 views
What is the reason and how can i solve this?
asked Dec 18, 2020 TeamScript 9.3k points
1 vote
2 answers 166 views
166 views
Problem : Getting bellow Minecraft error io.netty.channel.abstractchannel$annotatedconnectexception connection timed out no further informa
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 6 views
6 views
Can anyone solve this problem? I,m working on this.
asked Dec 15, 2020 TeamScript 9.3k points
0 votes
1 answer 102 views
102 views
Problem : I am facing the below error when I want to connect to the Minecraft server: This is occurring on all servers and not on just one. The error is as below: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: Version 1 ... Geforce's Overlay for game capturing and I don't have any of the mods installed. Please help me in resolving the issue.
asked Jan 16, 2020 jwilliam 3.9k points
0 votes
1 answer 160 views
0 votes
2 answers 10 views
10 views
Help me by solving this question.
asked Jan 4 TeamScript 9.3k points
1 vote
2 answers 119 views
119 views
Problem: I am able to login through webservices api to particular account on 'Oracle on demand'. When i tries to call 'accountQueryPage' method of the stub class (Stub class is generated with help Account.wsdl file), i got the following exception java.net.SocketException: Software caused connection abort: recv failed Can anyone give me some pointers.
asked Mar 27, 2020 LizzyM 6.1k points