Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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

http://javarevisited.blogspot.com/2013/02/java-net-ConnectException-Connection-refused.html

hope that helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.