ConcurrentModificationException using s:iterator (intermittent)
---------------------------------------------------------------

                 Key: WW-3019
                 URL: https://issues.apache.org/struts/browse/WW-3019
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.1.6
         Environment: OS:
Linux  2.6.18-92.1.13.el5 #1 SMP Wed Sep 24 19:33:52 EDT 2008 i686 i686 i386 
GNU/Linux
Glassfish:
Version = Sun Java System Application Server 9.1_02

            Reporter: Chris Dunphy
         Attachments: layout_wait.jsp, struts.xml, tiles.xml

I have an intermittent problem using the s:iterator tag with the waitAndExec 
interceptor.  Here is the file that I am trying to insert into the tiles layout 
(viewrequest.jsp):
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:if test="empeRequest.messages.size() > 0">
        <div class="box" style="background-color: #CCCCCC">
        <h3><s:property value="empeRequest.description" /></h3>
        <ul>
                <s:iterator value="empeRequest.messages">
                        <s:if test="status.toString() == 'NORMAL'">
                                <li style="background-color: 
#CCFFCC"><s:property
                                        value="message" /></li>
                        </s:if>
                        <s:elseif test="status.toString() == 'WARNING'">
                                <li style="background-color: 
#FFFFCC"><s:property
                                        value="message" /></li>
                        </s:elseif>
                        <s:elseif test="status.toString() == 'ERROR'">
                                <li style="background-color: 
#FFBBBB"><s:property
                                        value="message" /></li>
                        </s:elseif>
                </s:iterator>
        </ul>
        </div>
</s:if>

This is the layout page I am including the above file in (waitlayout.jsp):
<%@ taglib uri="http://tiles.apache.org/tags-tiles"; prefix="tiles"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
        <head>
                <meta http-equiv="refresh" content="5;url=<s:url 
includeParams="all" />" />
                <title>${application.title}</title>
                <style type="text/css">@import url( css/empe.css );</style>
        </head>
<body>
        <div class="force-scrollbar">&nbsp;</div>
        <div class="main">
                <div class="content">
                        <tiles:insertAttribute name="body" />
                        <tiles:insertAttribute name="viewRequest" />
                </div>
        </div>
</body>
</html>


This sometimes crashses with the following stack trace:
Caused by: java.util.ConcurrentModificationException
        at 
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
        at java.util.AbstractList$Itr.next(AbstractList.java:343)
        at 
org.apache.struts2.components.IteratorComponent.end(IteratorComponent.java:266)
        at 
org.apache.struts2.views.jsp.IteratorTag.doAfterBody(IteratorTag.java:69)
        at 
org.apache.jsp.jsp.fragments.viewrequest_jsp._jspx_meth_s_iterator_0(viewrequest_jsp.java
 from :177)
        at 
org.apache.jsp.jsp.fragments.viewrequest_jsp._jspx_meth_s_if_0(viewrequest_jsp.java
 from :108)
        at 
org.apache.jsp.jsp.fragments.viewrequest_jsp._jspService(viewrequest_jsp.java 
from :67)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
        at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at 
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at 
org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
        at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
        at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:660)
        at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:578)
        at 
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:997)
        at 
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:682)
        at 
org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
        ... 112 more

This doesn't happen consistently, but every third or forth run, which is enough 
to cause problems for users.  I don't suspect it is a tiles issue, but appears 
to be an issue with iterator based on the stack trace.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to