java.util.ConcurrentModificationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When initializing a collection, I get the following stacktrace (not seen with Hibernate 2.0.3): 8047 ERROR [tcpConnection-81-0] (webwork.dispatcher.ServletDispatcher:188) - Could not execute action java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.remove(HashMap.java:801) at net.sf.hibernate.impl.SessionImpl.endLoadingCollections(SessionImpl.java:2973) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:224) at net.sf.hibernate.loader.Loader.doFind(Loader.java:113) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:720) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:703) at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:74) at net.sf.hibernate.impl.SessionImpl.initialize(SessionImpl.java:3101) at net.sf.hibernate.collection.PersistentCollection.forceLoad(PersistentCollection.java:236) at net.sf.hibernate.Hibernate.initialize(Hibernate.java:255) at com.intrasoft.persistence.hibernate.HibernatePersistenceService.initialize(HibernatePersistenceService.java:143) at com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.initializeMission(AbstractMissionStepAction.java:112) at com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.saveMissionInSession(AbstractMissionStepAction.java:74) at com.intrasoft.sysaudit.mission.action.wizard.MissionStep1.doExecute(MissionStep1.java:173) at com.opensymphony.xwork.ActionSupport.execute(ActionSupport.java:31) Here is my code: if (mission.getUnit() != null) { persistenceService.initialize(mission.getUnit().getUsers()); } and in HibernatePersistenceService: public void initialize(Object objectToInitialize) { try { if (!Hibernate.isInitialized(objectToInitialize)) { Hibernate.initialize(objectToInitialize); } } catch (HibernateException e) { throw new InfrastructureException(e); } }
    via by Mathias Bogaert,
  • When initializing a collection, I get the following stacktrace (not seen with Hibernate 2.0.3): 8047 ERROR [tcpConnection-81-0] (webwork.dispatcher.ServletDispatcher:188) - Could not execute action java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.remove(HashMap.java:801) at net.sf.hibernate.impl.SessionImpl.endLoadingCollections(SessionImpl.java:2973) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:224) at net.sf.hibernate.loader.Loader.doFind(Loader.java:113) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:720) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:703) at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:74) at net.sf.hibernate.impl.SessionImpl.initialize(SessionImpl.java:3101) at net.sf.hibernate.collection.PersistentCollection.forceLoad(PersistentCollection.java:236) at net.sf.hibernate.Hibernate.initialize(Hibernate.java:255) at com.intrasoft.persistence.hibernate.HibernatePersistenceService.initialize(HibernatePersistenceService.java:143) at com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.initializeMission(AbstractMissionStepAction.java:112) at com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.saveMissionInSession(AbstractMissionStepAction.java:74) at com.intrasoft.sysaudit.mission.action.wizard.MissionStep1.doExecute(MissionStep1.java:173) at com.opensymphony.xwork.ActionSupport.execute(ActionSupport.java:31) Here is my code: if (mission.getUnit() != null) { persistenceService.initialize(mission.getUnit().getUsers()); } and in HibernatePersistenceService: public void initialize(Object objectToInitialize) { try { if (!Hibernate.isInitialized(objectToInitialize)) { Hibernate.initialize(objectToInitialize); } } catch (HibernateException e) { throw new InfrastructureException(e); } }
    via by Mathias Bogaert,
  • Deleting old data after an upgrade from the GUI fails with a ConcurrentModificationException javax.servlet.ServletException: java.util.ConcurrentModificationException at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:735) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:239) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:685) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:587) at org.kohsuke.stapler.Stapler.service(Stapler.java:218) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:248) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at winstone.RequestDispatcher.forward(RequestDispatcher.java:331) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.remove(HashMap.java:811) at hudson.diagnosis.OldDataMonitor.doDiscard(OldDataMonitor.java:276) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:297) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:160) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:95) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:685) ... 56 more
    via by Johannes Wienke,
    • java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.remove(HashMap.java:801) at net.sf.hibernate.impl.SessionImpl.endLoadingCollections(SessionImpl.java:2973) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:224) at net.sf.hibernate.loader.Loader.doFind(Loader.java:113) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:720) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:703) at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:74) at net.sf.hibernate.impl.SessionImpl.initialize(SessionImpl.java:3101) at net.sf.hibernate.collection.PersistentCollection.forceLoad(PersistentCollection.java:236) at net.sf.hibernate.Hibernate.initialize(Hibernate.java:255) at com.intrasoft.persistence.hibernate.HibernatePersistenceService.initialize(HibernatePersistenceService.java:143) at com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.initializeMission(AbstractMissionStepAction.java:112) at com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.saveMissionInSession(AbstractMissionStepAction.java:74) at com.intrasoft.sysaudit.mission.action.wizard.MissionStep1.doExecute(MissionStep1.java:173) at com.opensymphony.xwork.ActionSupport.execute(ActionSupport.java:31)

    Users with the same issue

    Unknown visitor2 times, last one,