Ashley Medway
Ashley Medway

Reputation: 7311

Java java.net.ConnectException: Connection refused

I'm having an issue when copying my application to the server. The program runs fine on my testing machine (Mac OS X), but when I deploy it on my server (Windows Server 2008), I get the following error:

java.net.ConnectException: Connection refused

I'm sure I've open the ports correctly for outbound connections. Just port 80 right?

Here's a code snippet if it helps

try {
    doc = Jsoup.connect("http://google.com").get();
} catch (IOException e) {
    e.printStackTrace();
    return;
}

Java isn't my main language, so let me know if there's anything more you need.

Upvotes: 0

Views: 6552

Answers (1)

partlov
partlov

Reputation: 14277

This problem almost always came up because of one of two reasons:
1) The server is not listening on right port
2) You have firewall which blocks out trafic

Try to stop your firewall temporarily and see what's going on.

Upvotes: 2

Related Questions