hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Glück <ortwin.glu...@nose.ch>
Subject Re: HttpRecoverableException
Date Fri, 20 Aug 2004 06:51:32 GMT
Dennis,

The question is, why does the method need to be retried in the first 
place. You should avoid having to retry expensive methods like POST and 
PUT normally. Furthermore a lot of questinos arise here:
  * Which version of HttpClient are you using?
  * Is it an authentication problem? (would expect a different exception)
  * Are you using a proxy by any chance?
  * Are you opening many simultanous connections to the same host?
  * Which HTTP Version does the server use?
  * Can you provide a wire log or packet log of the communication?

Thanks

Ortwin Glück

Labajo, Dennis wrote:
>  
> 
> Hi all.
> 
>  
> 
> I badly need help on an error (HttpRecoverableException) I'm getting.
> Here's part of my java source code:
> 
>  
> 
>  
> 
> << the class where httpclient instance is created >>
> 
>  
> 
> MultiThreadedHttpConnectionManager cmgr = new
> 
>       MultiThreadedHttpConnectionManager();
> 
> cmgr.setConnectionStaleCheckingEnabled( true );
> 
> cmgr.setMaxConnectionsPerHost( 10 );
> 
> cmgr.setMaxTotalConnections( 100 );
> 
> HttpClient httpclient = new HttpClient(cmgr);
> 
> httpclient.setConnectionTimeout(30000);
> 
> httpclient.setTimeout(30000);
> 
> httpclient.setState( this.commonHttpState);
> 
>  
> 
>  
> 
>  
> 
> << class where httppost is made >>
> 
>  
> 
> DefaultMethodRetryHandler methodretry = new DefaultMethodRetryHandler();
> 
> methodretry.setRequestSentRetryEnabled(true);
> 
> PostMethod httppost = new PostMethod(this.server_url.toString());
> 
> httppost.setMethodRetryHandler(methodretry);
> 
> httpClient.executeMethod(httppost);
> 
>  
> 
>  
> 
>  
> 
> I do see the recoverable exception caught three times:
> 
> 
> 
> 2004/08/19 11:55:44:650 CDT [INFO] HttpMethodBase - -Recoverable
> exception caught when processing request
> 
>  
> 
> But on the fourth recoverable exception, I get this:
> 
>  
> 
> 2004/08/19 11:56:07:440 CDT [WARN] HttpMethodBase - -Recoverable
> exception caught but MethodRetryHandler.retryMethod() returned false,
> rethrowing exception
> 
> 2004/08/19 11:56:07:440 CDT [DEBUG] MultiThreadedHttpConnectionManager -
> -Freeing connection,
> hostConfig=HostConfiguration[host=nwapeople2.nwa.com,
> protocol=https:443, port=443]
> 
> 2004/08/19 11:56:07:440 CDT [DEBUG] MultiThreadedHttpConnectionManager -
> -Notifying no-one, there are no waiting threads
> 
> 2004/08/19 11:56:07:490 CDT [WARN] MainMenu - -Web Service Exception:
> he.commons.httpclient.HttpRecoverableException: Error in parsing the
> status  line from the response: unable to find line starting with "HTTP"
> 
>  
> 
>  
> 
>  
> 
> Is there something I'm not doing right? 
> 
>  
> 
> Thanks.
> 
>  
> 
> Dennis
> 
>  
> 
>  
> 
>  
> 
> 

-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message