0

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.

2
  • Are you sure that you are not running behind a proxy? Can you connect through remote desktop to that server and check that you have access to the desired URL (also check the browser configuration to see if there's any proxy in place)? Commented Jan 9, 2013 at 20:53
  • Site is visible on server and there is no proxy Commented Jan 9, 2013 at 21:04

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I would add to that: 3)you are behind a web-proxy and your application is not using it to handle connections.
Yes, I just removed that because Ashley wrote that there is no proxy.
Sure, I mean, the item 3) would make the list more applicable for every "Connection refused" problem :)
there was a little more to it, but yeah basically it was a firewall thing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.