You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Tam <da...@hk.dbsvickers.com> on 2002/09/02 10:09:40 UTC

ConcurrentModificationException

i am using Struts 1.1b2 with tiles on BES 5.0.2(tomcat 4.0.1).  i ve got the
following form:


public final class fw_MenuItemAdminForm extends ActionForm {

    private List parmsAL = new FastArrayList();
    private Collection parms = col1.lazyList(parmsAL, fw_MenuItemParmVO.class);

    public void addParm(fw_MenuItemParmVO theParm){
        parms.add(theParm);
    }

    public Collection getParms(){
        return parms;
    }

}

and here is my jsp:

    <table>
    <tr>
    <td><bean:message key="menuItemAdminForm.parmKey"/>:</td>
    <td><bean:message key="menuItemAdminForm.parmVal"/>:</td>
    </tr>
    <nested:iterate id="menuItemParms" property="parms"
type="fw_MenuItemParmVO">
    <tr>
     <td><nested:write property="parmKey" /><nested:hidden property="parmKey"
/></td>
     <td><nested:write property="parmVal" /><nested:hidden property="parmVal"
/></td>
    </tr>
    </nested:iterate>

    </table>



when my dispatch action class is being called the following method is being
executed:

    public ActionForward addParm(ActionMapping mapping,
                                    ActionForm form,
                                    HttpServletRequest request,
                                    HttpServletResponse response) throws
Exception{

        fw_MenuItemAdminForm miaForm = (fw_MenuItemAdminForm)form;

        logger.debug("addParm:: miaForm.getParms().size() = " +
miaForm.getParms().size());

        miaForm.addParm(new fw_MenuItemParmVO(null, null, false));

        return (mapping.findForward("success"));

    }




the link to the "success" forward is ok(can tell from the log) but the servlet
container is throwing concurrentmodificationexception!  anybody knows y is this
happening??  seems that it could get though the action but when the servlet
container is formatting the HTML(or running the generated xxx$jsp.java) there is
this wierd problem.


137908 [VBJ ThreadPool Worker] DEBUG
hk.com.dbsvickers.webapp.framework.sms.fw_MenuItemAdminAction  - addParm::
miaForm.getParms().size() = 0
processActionForward(menuItemAdmin.AddLayout, false)
insert page='/jsp/NavSideBar.jsp'.
insert page='/jsp/NavTopBar.jsp'.
insert page='/jsp/basicLayout.content.jsp'.
insert page='/jsp/menuItemAdminDetailsPane.jsp'.
ApplicationDispatcher[/SMS_Web]: Servlet.service() for servlet jsp threw
exception
java.util.ConcurrentModificationException
 at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:440)
 at java.util.AbstractList$Itr.next(AbstractList.java:413)
 at org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java:423)
 at
org.apache.struts.taglib.nested.logic.NestedIterateTag.doAfterBody(NestedIterate
Tag.java:157)
 at
org.apache.jsp.menuItemAdminDetailsPane$jsp._jspService(menuItemAdminDetailsPane
$jsp.java:960)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:2
02)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java
:679)
 at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.j
ava:570)
 at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.jav
a:493)
 at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:818)
 at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:390)
 at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:8
65)
 at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:487)
 at
org.apache.jsp.basicLayout$content$jsp._jspService(basicLayout$content$jsp.java:
336)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
many many more......
.
.
.
.
.
.



  'menuItemAdmin.AddLayout' - processed as definition




regards,

dave


_______________________
CONFIDENTIALITY NOTICE:

This message, together with any attachment, is intended only for the use of the individual or entity to whom it is addressed and contains information that is privileged and confidential.  If you are not the intended recipient, please be informed that any dissemination, distribution or reproduction of this message (including any attachment) is strictly prohibited.  If you have received this message in error, please notify us immediately by return e-mail and delete the original message.  Thank you.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>