commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [HTTPClient] MethodRetryHandler.retryMethod() returned false
Date Mon, 08 Nov 2004 08:39:57 GMT
Brant,
All I can tell you is that the target server dropped the connection
while HttpClient was still reading the response.

Try using the so called expect-continue handshake and see if it makes
any difference. 

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/ExpectContinueMethod.html#setUseExpectHeader(boolean)

Many e-commerce sites do tricks to make automated HTML scraping VERY
difficult, so do expect it to take some efforts

Oleg


On Sun, Nov 07, 2004 at 10:22:04PM -0500, Brant Hahn wrote:
> Hi, 
> 
>  
> 
> I've returned to my attempts to use HttpClient to log-in to my bank's
> website.  I post my log-in variables, and execute the post method to do the
> log-in.  I get the following warning and stacktrace when executed:
> 
>  
> 
> WARNING: Recoverable exception caught but MethodRetryHandler.retryMethod()
> returned false, rethrowing exception
> 
> org.apache.commons.httpclient.HttpRecoverableException:
> java.net.SocketException: Connection reset
> 
>        at
> org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
> a:1962)
> 
>        at
> org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
> ava:2653)
> 
>        at
> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:108
> 7)
> 
>        at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
> 
>        at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
> 
>  
> 
> Before this, I was getting a redirect response taking me to a failed login
> page.  I had noticed that on the log-in page itself, there is some
> javascripting that adds two cookies.  Once I manually create those Cookies
> and added them to my HttpClient object's HttpState attribute, then re-tried
> the log-in attempt, I receive this connection reset error.  It seems that
> once I had added those two cookies, which are required, it is making the
> attempt to establish my log-in session.but this appears to be preventing it
> from happening.  Any tips on what could be done here or what is happning to
> my connection?  I'm using JRE 1.5 and v2.0.2 for HTTPClient.
> 
>  
> 
> Thanks,
> 
> Brett
> 

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


Mime
View raw message