hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: ArrayIndexOutOfBoundsException in CookieSpecBase
Date Thu, 02 Nov 2006 18:53:07 GMT
On Thu, 2006-11-02 at 10:23 -0800, Tim Eck wrote:
> I wonder if anyone has any hints for me....I'm getting this exception every so often
(every 100 or so runs):
> 
> java.lang.ArrayIndexOutOfBoundsException: 1
> 	at java.util.LinkedList.toArray(LinkedList.java:657)
> 	at org.apache.commons.httpclient.cookie.CookieSpecBase.match(CookieSpecBase.java:564)
> 	at org.apache.commons.httpclient.HttpMethodBase.addCookieRequestHeader(HttpMethodBase.java:1179)
> 	at org.apache.commons.httpclient.HttpMethodBase.addRequestHeaders(HttpMethodBase.java:1305)
> 	at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2036)
> 	at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1919)
> 	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
> 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
> 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
>          <my code snipped>
> 
> This is with HttpClient 3.0.1. I've seen this one at least two platforms (windows and
linux). I know it happens with 
> 1.4.2, not sure about 1.5. I'm only testing with Sun VMs.
> 
> The strange thing is that the code in CookieSpecBase looks like it can never produce
this exception (since the 
> LinkedList in question is local, and this isn't being modified by another thread).
> 
> Am I reading that code right? Any ideas what the heck can be going on? I don't suspect
a bug in httpclient.
> 

Tim,

I do not see how possibly HttpClient could be causing LinkedList#toArray
to throw an ArrayIndexOutOfBoundsException exception in this case. 

In this particular case I am more inclined to suspect a bug in Sun's
Java Runtime Library. If you knew what cookies HttpClient was trying to
match against which target host, I might be able to reproduce the
problem locally.

Oleg

> Link to the source I'm referring to
> http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_0_1/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java?revision=404763&view=markup
> 
> thanks in advance
> -tim
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 


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


Mime
View raw message