Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ConcurrentModificationException, please help

0 views
Skip to first unread message

shoa

unread,
Jul 5, 2005, 8:27:06 PM7/5/05
to
Hello
In my application, I have a button. When I click on this button, it will be
log off. However, there is a ConcurrentModificationException:
----------------------------------------------------------------------------
-------------
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)
at java.util.AbstractList$Itr.next(AbstractList.java:419)
at
com.crseducation.kokiridatabase.hauoraclient.currentuser.CurrentUser._$9098(
CurrentUser.java:308)
at
com.crseducation.kokiridatabase.hauoraclient.currentuser.CurrentUser.logoff(
CurrentUser.java:242)
at
com.crseducation.kokiridatabase.hauoraclient.guiapplication.MainWindow.login
(MainWindow.java:265)
at
com.crseducation.kokiridatabase.hauoraclient.guiapplication.MainWindow.login
_actionPerformed(MainWindow.java:257)
at
com.crseducation.kokiridatabase.hauoraclient.guiapplication.MainWindow_tbBut
tonLogin_actionAdapter.actionPerformed(MainWindow.java:355)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)

This was happend in this code
--------------------------------------------
private void signalLogoff(){
Iterator iterator = myListeners.iterator();
while(iterator.hasNext()){
CurrentUserListener listener = (CurrentUserListener) iterator.next();
//The error here
listener.userLoggedOff();
}
}
-----------------------------------------------
I know this is hard question. However, if you have any clue for this error,
please help
Many thanks

S.Hoa


Roedy Green

unread,
Jul 5, 2005, 8:25:37 PM7/5/05
to
On Wed, 6 Jul 2005 12:27:06 +1200, "shoa" <s...@slingshot.co.nz> wrote
or quoted :

>java.util.ConcurrentModificationException

see http://mindprod.com/jgloss/runerrormessages.html#CONCURRENTMOD
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes

shoa

unread,
Jul 5, 2005, 11:25:07 PM7/5/05
to
Thanks for your help. I already read the site. Howerver, in my application,
I do not have any Collection.remove function. Could you please explain more
details about this sentence.
-------------------------------------
You tried to delete or add to a Collection while you were in the middle of
running an Iterator over it. To get around this, you must remove elements
via the Iterator object using Iterator.remove rather than the usual
Collection.remove.
------------------
Many thanks

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:i79mc1pgd63agdfl0...@4ax.com...

Roedy Green

unread,
Jul 6, 2005, 4:27:36 AM7/6/05
to
On Wed, 6 Jul 2005 15:25:07 +1200, "shoa" <s...@slingshot.co.nz> wrote
or quoted :

>You tried to delete or add to a Collection while you were in the middle of


>running an Iterator over it. To get around this, you must remove elements
>via the Iterator object using Iterator.remove rather than the usual
>Collection.remove.

the basic idea is that collections are single thread. Further you
can't update them while an iterator is running, even on the same
thread, unless you update indirectly via the iterator.

0 new messages