You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/03/14 22:02:34 UTC
[jira] [Issue Comment Edited] (HTTPCLIENT-1173)
NoSuchElementException in
org.apache.http.impl.cookie.BestMatchSpec.formatCookies
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229608#comment-13229608 ]
Oleg Kalnichevski edited comment on HTTPCLIENT-1173 at 3/14/12 9:01 PM:
------------------------------------------------------------------------
I can't find anything wrong with the code just based on this exception stack trace. RequestAddCookies always creates a local instance of List<Cookie> [1]. So, this can't be a threading issue. BestMatchSpec does not explicitly call ArrayList#Itr.next. It uses 'for each' loop to iterate list items [2].
I will not be able to do much without a reproducer.
Oleg
[1] http://hc.apache.org/httpcomponents-client-ga/httpclient/xref/org/apache/http/client/protocol/RequestAddCookies.html#178
[2] http://hc.apache.org/httpcomponents-client-ga/httpclient/xref/org/apache/http/impl/cookie/BestMatchSpec.html#189
was (Author: olegk):
I can't find anything wrong with the code just based on this exception stack trace. RequestAddCookies always creates a local instance of List<Cookie> [1]. So, this can't be a threading issue. BestMatchSpec does not explicitly call ArrayList#Itr.next. It uses 'for each' loop to iterate list items [2].
I will not be able to do much without a reproducer.
Oleg
[1] hc.apache.org/httpcomponents-client-ga/httpclient/xref/org/apache/http/client/protocol/RequestAddCookies.html#178
[2] http://hc.apache.org/httpcomponents-client-ga/httpclient/xref/org/apache/http/impl/cookie/BestMatchSpec.html#189
> NoSuchElementException in org.apache.http.impl.cookie.BestMatchSpec.formatCookies
> ---------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1173
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1173
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.2, 4.1.3
> Environment: Ubuntu 10.04/OpenJDK 6
> Reporter: Christian Thieme
>
> I am using the HTTP client using a ThreadSafeClientConnManager. The application is creating up to 300 client threads.
> Occasionally the client starts to throw the following exception after running for several hours:
> at java.util.ArrayList$Itr.next(ArrayList.java:757)
> at org.apache.http.impl.cookie.BestMatchSpec.formatCookies(BestMatchSpec.java:189)
> at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:196)
> at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:174)
> at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:462)
> at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
> at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
> The requests do not contain any cookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org