Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ConcurrentModificationException  RSS feed

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A have a servlet which calls the below public method of another class. "context" is a ServletContext which was passed to the constructor of this class. In the removeAllCodes() method, I am simply looping through the atttribute names in the context.






I get the following exception:




Does this have to do with synchronizing the context? Thanks.
Eric
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're trying to remove items from the collection you're iterating over--not all collections allow that.

See here. Searching the web will provide other ideas.
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!