struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul-J Woodward" <>
Subject Re: ConcurrentModificationException on ActionErrors
Date Wed, 31 Dec 2003 15:51:01 GMT

I don't know what is causing the exact error from your code snippet, but a ConcurrentModificationException
is thrown when you try to modify a list on which you have an iterator.

See here:

Global Equity Derivatives Technology
Deutsche Bank [/]
Office  +44 (0)20 754 55458
Mobile +44 (0)7736 299483
Fax      +44 (0)20 7547 2752

                      "Richard Mixon                                                     
                      (qwest)"                 To:       "Struts Users Mailing List" <>
                      <rnmixon@custco.b        cc:                                    
                      iz>                      Subject:  ConcurrentModificationException
on ActionErrors                                                                          
                      31/12/2003 15:36                                                   
                      Please respond to                                                  
                      "Struts Users                                                      
                      Mailing List"                                                      

I have a Struts action that is trying to show all of the errors that might occur from either
or both of two subordinate methods. The
code looks like:

  ActionErrors errors = new ActionErrors();
  ActionErrors errors1 = null;
  ActionErrors errors2 = null;

  Obj1 obj1 = new Obj1();
  Obj2 obj2 = new Obj2();

  errors1 = obj1.getErrors();
  if (!errors1.isEmpty()) {

  errors2 = obj2.getErrors();
  if (!errors2.isEmpty()) {

Problem is I get the ConcurrentModificationException when I try and do either of the "errors.add"
methods above. Methods
method1/method2 are pretty vanilla, just doing some database work and accumulating any errors
in an associated ActionErrors.

I've searched the archives but only found one or two references to ConcurrentModificationException
and they did not involve
ActionErrors. Any ideas or help is appreciated.

- Richard

To unsubscribe, e-mail:
For additional commands, e-mail:


This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message