The most likely cause is that you've got an application-scoped collection (or
perhaps session-scoped) that has been modified in one thread while the iterate
tag is looping in another thread. Nothing really to do with the tag itself.

Quoting [EMAIL PROTECTED]:

> Hi,
> I did some loadtesting on a webapplication where i have several
> jsp-documents, each of them containing iterate-tags.
> When just one user is testing the application everything works fine, but
> during the loadtest i got an exception every now and then.
> The Exception looks like this:
> 
> java.util.ConcurrentModificationException
>         at java.util.AbstractList$Itr.checkForComodification(Unknown
> Source)
>         at java.util.AbstractList$Itr.next(Unknown Source)
>         at
> de.intersoft.web.taglib.logik.IterateTag.doAfterBody(IterateTag.java:523)
>         at jsp_servlet._bestand.__VertragsdatenDetails._jspService
> (__VertragsdatenDetails.java:3298)
>         at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
>         at
>
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:241)
>         at
>
de.intersoft.lifestream.wizard.WiControlServlet.leiteRequestWeiter(WiControlServlet.java:621)
>         at
> de.intersoft.lifestream.wizard.WiControlServlet.service(WiControlServlet.java:311)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
>         at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
>         at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
>         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
>         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> 
> We modified the IterateTag-class slightly, but we didn't write any new
> code, but instead only deleted unneccessary methods in order to have less
> dependencies to other classes.
> 
> The doAfterBody Method, where the exception is throws looks like this:
> 
>       public int doAfterBody() throws JspException
>       {
> 
>             // Render the output from this iteration to the output stream
>             if(bodyContent != null)
>             {
>                   TagUtil.writePrevious(pageContext, bodyContent.getString
> ());
>                   bodyContent.clearBody();
>             }
> 
>             // Decide whether to iterate or quit
>             if((lengthValue > 0) && (lengthCount >= lengthValue))
>                   return (SKIP_BODY);
> 
>             if(iterator.hasNext())
>             {
>                   // THE EXCEPTION IS THROWN IN THE NEXT ROW !!!!
>                   Object element = iterator.next();
> 
>                   if(element == null)
>                         pageContext.removeAttribute(id);
>                   else
>                         pageContext.setAttribute(id, element);
>                   lengthCount++;
>                   if(indexId != null)
>                         pageContext.setAttribute(indexId, new
> Integer(getIndex()));
>                   return (EVAL_BODY_TAG);
>             }
>             else
>                   return (SKIP_BODY);
> 
>       }
> 
> I know, that a ConcurrentModificationException occurs if for example the
> underlying collection of the Iterator is changed or the Iterator itself is
> changed while
> you use it in a while(...)-block or for(...)-block or something else, but
> as I said, we didn't write any new code, so I wonder if anyone else
> experienced these ConcurrentModificationExceptions in the Iterate-class yet
> ???
> 
> Thanks in advance,
> Dirk Bade

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

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

Reply via email to