struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fedor Smirnoff <fedorsmirn...@yahoo.com>
Subject Re: java.util.ConcurrentModificationException at org.apache.struts.action.ActionMessages.add(ActionMessages.java:185)
Date Sat, 21 Jun 2003 22:05:52 GMT
I am not using 2 threads, I was just saying than in
case of two threds being used, this Exception will be
thrown.  I can find whats the problem in my casei got
this:

     <html:select property="colorSelected">
       <html:options property="colorOptions"
 name="orderEntryForm"/>
     </html:select>
 
 where colorSelected is a String with getter and
 setter in the orderEntry form bean, and colorOptions
is being returned by a getter in the same bean as an
 ArrayList.
 Something like this:
 
   public ArrayList getColorOptions() {
       colorOptions.add("red");
       colorOptions.add("green");
       return colorOptions;

Exception is being thrown when I am tryin to run it,
however if I return a String[] instead of ArrayList,
evetyhing works great.

Any ideas?

Thaks
Fedor
--- Sandeep Takhar <sandeep_takhar@yahoo.com> wrote:
> You don't need two threads.
> 
> If you are using an iterator and are removing from
> the
> collection you are iterating over - you will get
> this
> error.
> 
> If you are using EJB CMP then you need to know how
> relationships work because it is easy to run into
> this.
> 
> sandeep
> --- Fedor Smirnoff <fedorsmirnoff@yahoo.com> wrote:
> > Hi I asked similar question and yet did not get an
> > answer, I dont know why its happening in my case,
> > however, I know that
> ConcurrentModificationException
> > is thrown when a thread is trying to modify a
> > collection while another thread is still iterating
> > it.
> > Dont know if it helps you or not sorry.
> > 
> > Sincerely,
> > Fedor
> > 
> > --- Michael Ruppin <mruppin@yahoo.com> wrote:
> > > I'm getting the following, using 1.1-rc1
> > > ActionMessages.add(ActionMessages messages):
> > > 
> > > [6/20/03 11:15:23:344 CDT]  2d4fa5a WebGroup    
> 
> > E
> > > SRVE0026E: [Servlet Error]-[AxisPortalServlet]:
> > > java.util.ConcurrentModificationException
> > > 	at
> > >
> >
>
java.util.AbstractList$Itr.checkForComodification(AbstractList.java(Inlined
> > > Compiled Code))
> > > 	at
> > >
> >
>
java.util.AbstractList$Itr.next(AbstractList.java(Compiled
> > > Code))
> > > 	at
> > >
> >
>
org.apache.struts.action.ActionMessages.add(ActionMessages.java:185)
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > SBC Yahoo! DSL - Now only $29.95 per month!
> > > http://sbc.yahoo.com
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > struts-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > struts-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message