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]

Reply via email to