Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Randy Burgess
I believe this exception occurs when you try and modify an ArrayList while
iterating over said list. ArrayList is not thread safe.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



 From: Othon Reyes Sanchez [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List user@struts.apache.org
 Date: Tue, 26 Feb 2008 12:39:40 -0600
 To: user@struts.apache.org
 Subject: java.util.ConcurrentModificationException at IteratorComponent
 
 I get the following exception when i do some stress test with jmeter.
 java.util.ConcurrentModificationException
   at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
   at java.util.AbstractList$Itr.next(Unknown Source)
   at org.apache.struts2.components.IteratorComponent.end(
 IteratorComponent.java:246)
   at org.apache.struts2.views.jsp.IteratorTag.doAfterBody(
 IteratorTag.java:68)
   at
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspx_meth_s_0
 05fiterator_005f0
 (frmPrestamo_jsp.java:1595)
   at
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspx_meth_s_0
 05fform_005f0
 (frmPrestamo_jsp.java:640)
   at
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspService
 (frmPrestamo_jsp.java:186)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
 :98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(
 JspServletWrapper.java:328)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(
 JspServlet.java:315)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
 ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
 ApplicationFilterChain.java:188)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(
 ApplicationDispatcher.java:691)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(
 ApplicationDispatcher.java:469)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(
 ApplicationDispatcher.java:403)
   at org.apache.catalina.core.ApplicationDispatcher.forward(
 ApplicationDispatcher.java:301)
   at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(
 ServletDispatcherResult.java:139)
   at org.apache.struts2.dispatcher.StrutsResultSupport.execute(
 StrutsResultSupport.java:178)
   at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
 DefaultActionInvocation.java:348)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
 DefaultActionInvocation.java:253)
   at
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(
 DefaultWorkflowInterceptor.java:221)
   at
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
 MethodFilterInterceptor.java:86)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
 DefaultActionInvocation.java:224)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
 DefaultActionInvocation.java:223)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
 UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
 DefaultActionInvocation.java:221)
   at
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(
 ValidationInterceptor.java:150)
   at
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIn
 tercept
 (AnnotationValidationInterceptor.java:48)
   at
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
 MethodFilterInterceptor.java:86)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
 DefaultActionInvocation.java:224)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
 DefaultActionInvocation.java:223)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
 UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
 DefaultActionInvocation.java:221)
   at
 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(
 ConversionErrorInterceptor.java:123)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
 DefaultActionInvocation.java:224)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
 DefaultActionInvocation.java:223)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
 UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
 DefaultActionInvocation.java:221)
   at
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(
 ParametersInterceptor.java:167)
   at
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
 MethodFilterInterceptor.java:86)
   

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Othon Reyes Sanchez
do you know a collection that is thread safe?


On Tue, Feb 26, 2008 at 12:42 PM, Randy Burgess [EMAIL PROTECTED] wrote:

 I believe this exception occurs when you try and modify an ArrayList while
 iterating over said list. ArrayList is not thread safe.

 Regards,
 Randy Burgess
 Sr. Web Applications Developer
 Nuvox Communications



  From: Othon Reyes Sanchez [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List user@struts.apache.org
  Date: Tue, 26 Feb 2008 12:39:40 -0600
  To: user@struts.apache.org
  Subject: java.util.ConcurrentModificationException at IteratorComponent
 
  I get the following exception when i do some stress test with jmeter.
  java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown
 Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at org.apache.struts2.components.IteratorComponent.end(
  IteratorComponent.java:246)
at org.apache.struts2.views.jsp.IteratorTag.doAfterBody(
  IteratorTag.java:68)
at
 
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspx_meth_s_0
  05fiterator_005f0
  (frmPrestamo_jsp.java:1595)
at
 
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspx_meth_s_0
  05fform_005f0
  (frmPrestamo_jsp.java:640)
at
 
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspService
  (frmPrestamo_jsp.java:186)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
  :98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(
  JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
  JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java
 :265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
  ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
  ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(
  ApplicationDispatcher.java:691)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(
  ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(
  ApplicationDispatcher.java:403)
at org.apache.catalina.core.ApplicationDispatcher.forward(
  ApplicationDispatcher.java:301)
at
 org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(
  ServletDispatcherResult.java:139)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(
  StrutsResultSupport.java:178)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
  DefaultActionInvocation.java:348)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
  DefaultActionInvocation.java:253)
at
 
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept
 (
  DefaultWorkflowInterceptor.java:221)
at
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
  MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
  DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
  DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
  UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
  DefaultActionInvocation.java:221)
at
  com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(
  ValidationInterceptor.java:150)
at
 
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIn
  tercept
  (AnnotationValidationInterceptor.java:48)
at
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
  MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
  DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
  DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
  UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
  DefaultActionInvocation.java:221)
at
  com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept
 (
  ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
  DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
  DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
  UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
  DefaultActionInvocation.java:221)

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Dave Newton
--- Othon Reyes Sanchez [EMAIL PROTECTED] wrote:
 do you know a collection that is thread safe?

Look in the JavaDocs: not only are there thread-safe collections but there
are utility methods to create them from non-thread-safe collections.

As I said in your JIRA post you should post the action and JSP that's
actually causing the problem.

You also state that your action is in the session, which would concern me a
little.

Are you actually attempting to modify the collection somewhere, or is it a
display-only list?

Dave


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



Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Eduardo Dela Rosa
You stick to your code. However, update your code part such that when
create  your ArrayList, do it as Collections.synchronizedList(new
ArrayList(...)).

Also, you must be removing or updating object directly inside your list
object which is why you're getting this error. Try to get a reference to
Iterator from your ArrayList object and invoke remove or add methods via
the Iterator to get away from the ConcurrentModificationException.

HTH

Eduardo


On Wed, Feb 27, 2008 at 5:48 AM, Othon Reyes Sanchez [EMAIL PROTECTED]
wrote:

 do you know a collection that is thread safe?


 On Tue, Feb 26, 2008 at 12:42 PM, Randy Burgess [EMAIL PROTECTED]
 wrote:

  I believe this exception occurs when you try and modify an ArrayList
 while
  iterating over said list. ArrayList is not thread safe.
 
  Regards,
  Randy Burgess
  Sr. Web Applications Developer
  Nuvox Communications
 
 
 
   From: Othon Reyes Sanchez [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List user@struts.apache.org
   Date: Tue, 26 Feb 2008 12:39:40 -0600
   To: user@struts.apache.org
   Subject: java.util.ConcurrentModificationException at
 IteratorComponent
  
   I get the following exception when i do some stress test with jmeter.
   java.util.ConcurrentModificationException
 at java.util.AbstractList$Itr.checkForComodification(Unknown
  Source)
 at java.util.AbstractList$Itr.next(Unknown Source)
 at org.apache.struts2.components.IteratorComponent.end(
   IteratorComponent.java:246)
 at org.apache.struts2.views.jsp.IteratorTag.doAfterBody(
   IteratorTag.java:68)
 at
  
 
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspx_meth_s_0
   05fiterator_005f0
   (frmPrestamo_jsp.java:1595)
 at
  
 
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspx_meth_s_0
   05fform_005f0
   (frmPrestamo_jsp.java:640)
 at
  
 
 org.apache.jsp.jupiters2.archivo.jsp.expediente.frmPrestamo_jsp._jspService
   (frmPrestamo_jsp.java:186)
 at org.apache.jasper.runtime.HttpJspBase.service(
 HttpJspBase.java
   :98)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.jasper.servlet.JspServletWrapper.service(
   JspServletWrapper.java:328)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(
   JspServlet.java:315)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java
  :265)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
   ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(
   ApplicationFilterChain.java:188)
 at org.apache.catalina.core.ApplicationDispatcher.invoke(
   ApplicationDispatcher.java:691)
 at
 org.apache.catalina.core.ApplicationDispatcher.processRequest(
   ApplicationDispatcher.java:469)
 at org.apache.catalina.core.ApplicationDispatcher.doForward(
   ApplicationDispatcher.java:403)
 at org.apache.catalina.core.ApplicationDispatcher.forward(
   ApplicationDispatcher.java:301)
 at
  org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(
   ServletDispatcherResult.java:139)
 at org.apache.struts2.dispatcher.StrutsResultSupport.execute(
   StrutsResultSupport.java:178)
 at
 com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
   DefaultActionInvocation.java:348)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
   DefaultActionInvocation.java:253)
 at
  
 
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept
  (
   DefaultWorkflowInterceptor.java:221)
 at
   com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
   MethodFilterInterceptor.java:86)
 at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
   DefaultActionInvocation.java:224)
 at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
   DefaultActionInvocation.java:223)
 at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
   UtilTimerStack.java:455)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
   DefaultActionInvocation.java:221)
 at
   com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(
   ValidationInterceptor.java:150)
 at
  
 
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIn
   tercept
   (AnnotationValidationInterceptor.java:48)
 at
   com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
   MethodFilterInterceptor.java:86)
 at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
   DefaultActionInvocation.java:224)
 at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
   DefaultActionInvocation.java:223)
 at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
   

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Dave Newton
--- Eduardo Dela Rosa [EMAIL PROTECTED] wrote:
 Also, you must be removing or updating object directly inside your list
 object which is why you're getting this error. Try to get a reference to
 Iterator from your ArrayList object and invoke remove or add methods
 via the Iterator to get away from the ConcurrentModificationException.

Strictly speaking I don't believe that's necessarily true; one can get a
ConcurrentModificationException depending on how a map object is accessed in
the iterator.

(Not totally relevant since we're talking about lists, but thought I'd throw
that out there.)

Dave


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



Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Eduardo Dela Rosa
You are right there. And I guess the best way to rid this exception then is
to have the code part in synchronized block, i.e., synchronizing on the list
object itself + get the iterator + invoke either add or remove inside
the block. This will hurt the performance a bit BUT will preserve the
integrity of the content of the list.

On Wed, Feb 27, 2008 at 9:50 AM, Dave Newton [EMAIL PROTECTED] wrote:

 --- Eduardo Dela Rosa [EMAIL PROTECTED] wrote:
  Also, you must be removing or updating object directly inside your list
  object which is why you're getting this error. Try to get a reference to
  Iterator from your ArrayList object and invoke remove or add methods
  via the Iterator to get away from the ConcurrentModificationException.

 Strictly speaking I don't believe that's necessarily true; one can get a
 ConcurrentModificationException depending on how a map object is accessed
 in
 the iterator.

 (Not totally relevant since we're talking about lists, but thought I'd
 throw
 that out there.)

 Dave


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




-- 
Eduardo Dela Rosa


Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Randy Burgess
Or just use a Vector instead of an ArrayList, which is synchronized.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



 From: Eduardo Dela Rosa [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List user@struts.apache.org
 Date: Wed, 27 Feb 2008 09:59:25 +1100
 To: Struts Users Mailing List user@struts.apache.org
 Subject: Re: java.util.ConcurrentModificationException at IteratorComponent
 
 You are right there. And I guess the best way to rid this exception then is
 to have the code part in synchronized block, i.e., synchronizing on the list
 object itself + get the iterator + invoke either add or remove inside
 the block. This will hurt the performance a bit BUT will preserve the
 integrity of the content of the list.
 
 On Wed, Feb 27, 2008 at 9:50 AM, Dave Newton [EMAIL PROTECTED] wrote:
 
 --- Eduardo Dela Rosa [EMAIL PROTECTED] wrote:
 Also, you must be removing or updating object directly inside your list
 object which is why you're getting this error. Try to get a reference to
 Iterator from your ArrayList object and invoke remove or add methods
 via the Iterator to get away from the ConcurrentModificationException.
 
 Strictly speaking I don't believe that's necessarily true; one can get a
 ConcurrentModificationException depending on how a map object is accessed
 in
 the iterator.
 
 (Not totally relevant since we're talking about lists, but thought I'd
 throw
 that out there.)
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 Eduardo Dela Rosa



This email and any attachments (Message) may contain legally privileged 
and/or confidential information.  If you are not the addressee, or if this 
Message has been addressed to you in error, you are not authorized to read, 
copy, or distribute it, and we ask that you please delete it (including all 
copies) and notify the sender by return email.  Delivery of this Message to any 
person other than the intended recipient(s) shall not be deemed a waiver of 
confidentiality and/or a privilege.

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



Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Dave Newton
No no, I mean that even if you're not modifying the map you can get a
concurrent modification exception by accessing the map via OGNL's []
notation, just in an s:property.../ tag.

Dave

--- Eduardo Dela Rosa [EMAIL PROTECTED] wrote:

 You are right there. And I guess the best way to rid this exception then is
 to have the code part in synchronized block, i.e., synchronizing on the
 list
 object itself + get the iterator + invoke either add or remove inside
 the block. This will hurt the performance a bit BUT will preserve the
 integrity of the content of the list.
 
 On Wed, Feb 27, 2008 at 9:50 AM, Dave Newton [EMAIL PROTECTED] wrote:
 
  --- Eduardo Dela Rosa [EMAIL PROTECTED] wrote:
   Also, you must be removing or updating object directly inside your list
   object which is why you're getting this error. Try to get a reference
 to
   Iterator from your ArrayList object and invoke remove or add
 methods
   via the Iterator to get away from the ConcurrentModificationException.
 
  Strictly speaking I don't believe that's necessarily true; one can get a
  ConcurrentModificationException depending on how a map object is accessed
  in
  the iterator.
 
  (Not totally relevant since we're talking about lists, but thought I'd
  throw
  that out there.)
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 Eduardo Dela Rosa
 


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



RE: java.util.ConcurrentModificationException

2004-07-08 Thread Andrew Hill
When you iterate the vector in your action are you modifying its contents in
any way (ie: using add or remove, etc...)?

-Original Message-
From: Richard Aukland [mailto:[EMAIL PROTECTED]
Sent: Thursday, 8 July 2004 20:46
To: [EMAIL PROTECTED]
Subject: java.util.ConcurrentModificationException


Dear All,

I am having problems with java.util.ConcurrentModificationException.

I have a FormBean memberForm which contains a Vector of
membershipTypeForms.

Whenever I try and access the membershipTypeForms through an iterator
in my Action, (Data Access class) I get the exception.

In my jsp I use logic:iterate to iterate through the vector and
apart from this I dont seem to have any other iterators using the
collection.

Is the iterator tag likely to be the problem, if so does anybosy have
any idea how to fox this? or should I be searching through the rest
of my code for some kind of reference?

Many thanks for any help

Richard



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


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



RE: java.util.ConcurrentModificationException

2004-07-08 Thread Richard Aukland
Thankyou Andrew,

I am probably being a total java kook as I am fairly new, but here is
my code;

//need to go through the membershipTypeForm and build array of value
objects which we update with data tier
Iterator it = membershipTypesForm.getMembershipTypes_().iterator();

MembershipTypeBeanValue value[] = new
MembershipTypeBeanValue[membershipTypesForm.getMembershipTypes_().size
()]; 

int count=0;
while(it.hasNext()){
MembershipTypeForm form = (MembershipTypeForm)it.next();
value[count] = new MembershipTypeBeanValue();
BeanUtils.copyProperties(value[count],form);
}


It is the Class cast which causes the exception, I assume that this
must not be possible then?

many thanks

Richard



When you iterate the vector in your action are you modifying its
contents in
any way (ie: using add or remove, etc...)?

-Original Message-
From: Richard Aukland [mailto:[EMAIL PROTECTED]
Sent: Thursday, 8 July 2004 20:46
To: [EMAIL PROTECTED]
Subject: java.util.ConcurrentModificationException


Dear All,

I am having problems with java.util.ConcurrentModificationException.

I have a FormBean memberForm which contains a Vector of
membershipTypeForms.

Whenever I try and access the membershipTypeForms through an iterator
in my Action, (Data Access class) I get the exception.

In my jsp I use logic:iterate to iterate through the vector and
apart from this I dont seem to have any other iterators using the
collection.

Is the iterator tag likely to be the problem, if so does anybosy have
any idea how to fox this? or should I be searching through the rest
of my code for some kind of reference?

Many thanks for any help

Richard



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



RE: java.util.ConcurrentModificationException

2004-07-08 Thread McCormack, Chris
Without looking deeper in to this could it be a case of :

  while(it.hasNext()){
 MembershipTypeForm form = (MembershipTypeForm)it.next();
 value[count] = new MembershipTypeBeanValue();
 BeanUtils.copyProperties(value[count],form);   
 count++; // -- this 
   }

-Original Message-
From: Richard Aukland [mailto:[EMAIL PROTECTED]
Sent: 08 July 2004 14:08
To: [EMAIL PROTECTED]
Subject: RE: java.util.ConcurrentModificationException


Thankyou Andrew,

I am probably being a total java kook as I am fairly new, but here is
my code;

//need to go through the membershipTypeForm and build array of value
objects which we update with data tier
Iterator it = membershipTypesForm.getMembershipTypes_().iterator();

MembershipTypeBeanValue value[] = new
MembershipTypeBeanValue[membershipTypesForm.getMembershipTypes_().size
()]; 

int count=0;
while(it.hasNext()){
MembershipTypeForm form = (MembershipTypeForm)it.next();
value[count] = new MembershipTypeBeanValue();
BeanUtils.copyProperties(value[count],form);
}


It is the Class cast which causes the exception, I assume that this
must not be possible then?

many thanks

Richard



When you iterate the vector in your action are you modifying its
contents in
any way (ie: using add or remove, etc...)?

-Original Message-
From: Richard Aukland [mailto:[EMAIL PROTECTED]
Sent: Thursday, 8 July 2004 20:46
To: [EMAIL PROTECTED]
Subject: java.util.ConcurrentModificationException


Dear All,

I am having problems with java.util.ConcurrentModificationException.

I have a FormBean memberForm which contains a Vector of
membershipTypeForms.

Whenever I try and access the membershipTypeForms through an iterator
in my Action, (Data Access class) I get the exception.

In my jsp I use logic:iterate to iterate through the vector and
apart from this I dont seem to have any other iterators using the
collection.

Is the iterator tag likely to be the problem, if so does anybosy have
any idea how to fox this? or should I be searching through the rest
of my code for some kind of reference?

Many thanks for any help

Richard



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


***
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.



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