I am unable to connect to any host through Java programs, getting
java.net.ConnectException: Connection refused.
Does it have anything to do with Ubuntu firewall configurations or any other setting? I am running Ubuntu 12.04 LTS
Method1 First try to ping destination host , if host is ping-able it means client and server machine are in network.
Method2 Try connecting to server host and port using telnet. If you are able to connect means something is wrong with your client code. Also by observing telnet output you will come to know whether server is running or not or server is disconnecting the connection.
If you would like to know more about this error I mean why it is happening and how then please click the following
hope that helps.