Java Connection refused
<p>I have the following simple code programmed to automatically enter data to a website. However, I get the following error: </p>

<p><code>Exception in thread "main" java.net.ConnectException: Connection refused: connect</code></p>

<p>I am using NetBeans.</p>

<p>Code:</p>

<pre><code>import java.io.IOException;
import java.net.URL;
import java.util.List;
import java.util.Scanner;

import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlTable;
import com.gargoylesoftware.htmlunit.html.HtmlTableRow;
import com.gargoylesoftware.htmlunit.html.*;


public class ts {

    public static void main(String[] args) throws IOException{
        final WebClient webClient = new WebClient();
        HtmlPage page = (HtmlPage)webClient.getPage( new URL("http://rise4fun.com/QuickCode") );
        final HtmlForm form = (HtmlForm)page.getFormsByName("form1").get(0);
        final HtmlInput inp = form.getInputByName("SourceBox");
        inp.setValueAttribute("24.9.2011 | 24 Sep 2011\n8/15/2010");
         HtmlSubmitInput sub=(HtmlSubmitInput) page.getHtmlElementById("AskButton");
         page = (HtmlPage)sub.submit();   
         final String pageAsText = page.asText();
         HtmlElement out=page.getHtmlElementById("OutputBox");
         System.out.println(out.asText());

    }

}
</code></pre>
