• Register
0 votes
56 views

Problem :

I am getting bellow error 
java.net.connectexception: connection refused: no further information:
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

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

Related questions

0 votes
2 answers 107 views
107 views
Problem : Getting bellow error java.net.connectexception connection timed out no further information
asked Oct 31, 2019 peterlaw 6.9k points
1 vote
1 answer 4 views
4 views
Problem: Why I got the error : java.net.connectexception connection refused no further information
asked Mar 25 MUHAMMAD MUNEEB 82.5k points
0 votes
1 answer 26 views
26 views
Solve this.
asked Dec 26, 2020 TeamScript 13.5k points
0 votes
2 answers 604 views
604 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
1 vote
1 answer 4 views
4 views
Problem: How can I deal with this problem : java.net.connectexception: connection refused (connection refused)
asked Mar 25 MUHAMMAD MUNEEB 82.5k points
1 vote
1 answer 6 views
6 views
Problem: I need a help , How I can fix this : java.net.connectexception: connection refused: connect
asked Mar 25 MUHAMMAD MUNEEB 82.5k points
1 vote
1 answer 2 views
2 views
Problem: How to fix this error : java.net.connectexception: connection refused: connect error while installing apk
asked Mar 25 MUHAMMAD MUNEEB 82.5k points
0 votes
1 answer 11 views
11 views
Problem: I need to arrange a Hadoop-bunch in pseudo-disseminated mode. I figured out how to play out all the arrangement steps, including starting a Namenode, Datanode, Jobtracker, and a Tasktracker on my machine. At that point, I attempted to run some excellent ... 'm new to Hadoop and a fledgling Ubuntu client consequently I benevolently ask you for "considering" if giving any guide or tip).
asked Feb 19 TeamScript 13.5k points
0 votes
1 answer 22 views
22 views
Can anyone solve this problem? I,m working on this.
asked Dec 15, 2020 TeamScript 13.5k points
0 votes
1 answer 30 views
30 views
Any suggestions on what could be?
asked Jan 24 TeamScript 13.5k points