struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Aukland" <rich...@aukinfo.com>
Subject RE: java.util.ConcurrentModificationException
Date Thu, 08 Jul 2004 13:08:05 GMT
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:richard@aukinfo.com]
Sent: Thursday, 8 July 2004 20:46
To: struts-user@jakarta.apache.org
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message