Hi Mike,

The URL is correct. The GetMethod is executed within a for loop, and this exception occured only in some loops...

Well, maybe it is the server that cannot cope up the speed, and delaying the loop might help in this case.

Anyway, what is the HttpClient.setTimeout() really means? Why it is not applicable in this case where the server could be down/slow in returning the response?


From: Michael Becke <[EMAIL PROTECTED]>
Reply-To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
Subject: Re: HttpClient ConnectException: Connection refused: connect
Date: Wed, 11 Aug 2004 22:59:22 -0400

Hi TJ,

The host/port you are connecting to appears to not be listening. Please double check the URL you're connecting to and give it a try in a browser to make sure it's actually there.

Mike

On Aug 11, 2004, at 10:41 PM, T.J. Hoo wrote:

I encounter ConnectException: Connection refused: connect
eventhough I set the timeout to 0 (infinite timeout?), what could be the problem?


My program:

MultiThreadedHttpConnectionManager connManager = new MultiThreadedHttpConnectionManager();
client = new HttpClient(connManager);
client.setTimeout(0);


the exception:

java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.cre ateSocket(DefaultProtocolSocketFactory.java:86)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java: 651)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCo nnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java: 628)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java: 497)


_________________________________________________________________
Download the latest MSN Messenger http://messenger.msn.com.my


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________ Are you in love? Find a date on MSN Personals http://match.msn.com.my/


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to