hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Warnig when HttpClient Timeout
Date Wed, 11 Feb 2009 16:56:58 GMT
Pere LluĂ­s Albert wrote:
> Hello,
> 
> I get this warning when I have a HTTP Timeout
> 
> SimpleHttpConnectionManager being used incorrectly.  Be sure that
> HttpMethod.releaseConnection() is always called and that only one
> thread and/or method is using this connection manager at a time.
> 
> Is it normal? Am I doing something incorrectly or is it a bug?
> 

Please post a context / wire log of the session.

http://hc.apache.org/httpclient-3.x/logging.html

Oleg


> 
> Here is the code:
> 
> -------------------------------------------------------------------------------------------------------
> 
> HttpClient client = new HttpClient();
> 
> PostMethod method = new PostMethod(strMyInterface);
> 
> // setting Timeout
> client.getParams().setParameter("http.socket.timeout", 10000);
> 
> 
> try {
> 
>  // Execute the method.
>  int statusCode = client.executeMethod(method);
> 
>  // Read the response body.
>  byte[] responseBody = method.getResponseBody();
> 
> 
> } catch (HttpException e) {
> 
>  System.err.println("Fatal protocol violation: " + e.getMessage());
>  e.printStackTrace();
> 
> } catch (IOException e) {
> 
>  System.err.println("Fatal transport error: " + e.getMessage());
>  e.printStackTrace();
> 
> } finally {
> 
>  // Release the connection.
>  method.releaseConnection();
> 
> }
> 
> ---------------------------------------------------------------------------------------------------------------------------------
> 
> Thanks in advance.
> 
> Pere
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message