Loading...

httpclient-user@jakarta.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: java.util.ConcurrentModificationException Mark Claassen Wed Nov 15 18:03:32 2006

Are you familiar with the ConcurrentModificationException?  This means that
the underlying java.util.list is changing while an Iterator is being used.
I.E.  If you are stepping through something with an Iterator, you can't do
something like List.remove(index) and expect you iterator to continue to
function.  Are you doing something like this?  If you need to do something
like this, you can use a ListIterator instead of an Iterator and then use
the ListIterator's remove() method.

I haven't had any troubles with my 3.01 version, so I am guessing that maybe
you are manipulating this somehow?

Mark
 
-----Original Message-----
From: Lalit Sahoo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 15, 2006 4:57 AM
To: Httpclientusergroup (E-mail)
Subject: java.util.ConcurrentModificationException

Hi All,

While using HttpClient in multithreaded environment I am getting following
error:

java.util.ConcurrentModificationException
        at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)
        at java.util.AbstractList$Itr.next(AbstractList.java:419)
        at
org.apache.commons.httpclient.HeaderGroup.getHeaders(HeaderGroup.java:142)
        at
org.apache.commons.httpclient.HttpMethodBase.addCookieRequestHeader(HttpMeth
odBase.java:1167)
        at
org.apache.commons.httpclient.HttpMethodBase.addRequestHeaders(HttpMethodBas
e.java:1320)
        at
org.apache.commons.httpclient.methods.ExpectContinueMethod.addRequestHeaders
(ExpectContinueMethod.java:184)
        at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.addRequestHeader
s(EntityEnclosingMethod.java:372)
        at
org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodB
ase.java:2079)
        at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.jav
a:1962)
        at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:994
)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethod
Director.java:397)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDir
ector.java:170)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
        at
ae.cramer.com.httpevaluator.ApacheHTTPClientEvaluator.sendCommand(ApacheHTTP
ClientEvaluator.java:186)
        at
ae.cramer.com.httpevaluator.ApacheHTTPClientEvaluator.execute(ApacheHTTPClie
ntEvaluator.java:250)
        at ae.cramer.com.test.EvaluationTest.run(EvaluationTest.java:39)
        at java.lang.Thread.run(Thread.java:534)

Can anybody help in this regard?

Regards,
Lalit


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]