• Register
0 votes
96 views

Problem :

I am getting bellow error 
java.net.connectexception: connection refused: no further information:
6.9k 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 {

38.6k points

Related questions

0 votes
1 answer 11 views
11 views
Problem: Please assist if anyone understands the problem: Java.net connectexception connection timed out no further information
asked Jun 18 nila 121k points
0 votes
1 answer 13 views
13 views
Problem: My problem is that I get the "java.net.ConnectException: Connection refused: connect" Exception when I run the client on another network (my phones hotspot). It works fine on the same network, I think its a problem with the firewall, but even after enabling Eclipse and ... dis.readUTF(); System.out.println("message= "+str); ss.close(); }catch(Exception e){System.out.println(e);} } }
asked May 1 Yeamin 23.5k points
0 votes
1 answer 16 views
16 views
Problem: I am trying to use Azure notification hub, via Java. When trying to do create registration, I get a java.net.ConnectException: Connection timed out: no further information. Can someone help me understand why this issue ... .finishConnect(Unknown Source) at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) ... 7 more
asked Apr 26 anika11 32.2k points
0 votes
1 answer 20 views
20 views
Problem: I am really trying to use Azure notification hub, via Java. When trying to do create registration, I get a java.net.ConnectException: Connection timed out: no further information. Can someone help me understand why this ... .finishConnect(Unknown Source) at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) ... 7 more
asked Apr 26 anika11 32.2k points
0 votes
2 answers 154 views
154 views
Problem : Getting bellow error java.net.connectexception connection timed out no further information
asked Oct 31, 2019 peterlaw 6.9k points
0 votes
1 answer 15 views
15 views
Problem: How do I solve this issue: Java.net.connectexception: connection refused: no further information?
asked Jun 17 akhi 125k points
0 votes
1 answer 16 views
16 views
Problem: When I run this programm it show this mistake. Dose it because i donot run the service? How to writ config files for the following code? com.zeroc.Ice.ObjectPrx obj = communicator.stringToProxy("IceStorm/TopicManager:tcp -p 10000"); com.zeroc.IceStorm.TopicManagerPrx topicManager = com.zeroc.IceStorm.TopicManagerPrx.checkedCast(obj);
asked May 3 sumaiya simi 43.9k points
1 vote
1 answer 9 views
9 views
Problem: Why I got the error : java.net.connectexception connection refused no further information
asked Mar 25 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 48 views
48 views
Solve this.
asked Dec 26, 2020 TeamScript 13.5k points
0 votes
1 answer 11 views
11 views
Problem: I am trying to use Azure notification hub, via Java. When trying to do create registration, I get a java.net.ConnectException: Connection timed out: no further information. Can someone help me understand why this issue ... .finishConnect(Unknown Source) at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) ... 7 more
asked Apr 26 anika11 32.2k points