Home  >  Forum  >  Core Java
Post New Query

java.util.ConcurrentModificationException


joined on
April 07,2013
Asked on April 21,2013
Hi I am running a multi-threading program and getting below error.

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Any suggestion.
joined on
March 16,2013
Replied on April 21,2013

It seems that more than one thread are trying to update  a variable.
joined on
March 14,2013
Replied on April 21,2013

As error says that yo have used  hashmap in multi threading environment, you need to use
ConcurrentHashMap

Write Answer



Sitewide-Feb4of4234x60





Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us