Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Fix java.net.ConnectException: Connection refused: connect in Java

java.net.ConnectException: Connection refused: connect is one of the most common networking exceptions in Java. This error comes when you are working with client-server architecture and trying to make a TCP connection from the client to the server. Though this is not as cryptic as java.lang.OutOfMemoryError: Java heap space or java.lang.UnsupportedClassVersionError, it’s still a frequent problem in distributed Java applications. java.net.ConnectException: Connection refused: connect also comes in the case of RMI (Remote Method Invocation) because RMI also uses TCP-IP protocol underneath. While writing client socket code in Java, You should always provide proper handling of this exception. 


This post first appeared on Javarevisited: Blog About Java Programmin, please read the originial post: here

Share the post

How to Fix java.net.ConnectException: Connection refused: connect in Java

×

Subscribe to Javarevisited: Blog About Java Programmin

Get updates delivered right to your inbox!

Thank you for your subscription

×