java.util.ConcurrentModificationException

Hibernate JIRA | Mathias Bogaert | 1 decade ago
  1. 0

    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); } }

    Hibernate JIRA | 1 decade ago | Mathias Bogaert
    java.util.ConcurrentModificationException
  2. 0

    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); } }

    Hibernate JIRA | 1 decade ago | Mathias Bogaert
    java.util.ConcurrentModificationException
  3. 0

    webbit ConcurrentModificationException

    GitHub | 3 years ago | lukeis
    java.util.ConcurrentModificationException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Chrono Anchor + Death + HQM = boom

    GitHub | 2 years ago | Darkmega18
    java.util.ConcurrentModificationException

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.ConcurrentModificationException

      No message provided

      at java.util.HashMap$HashIterator.remove()
    2. Java RT
      HashMap$HashIterator.remove
      1. java.util.HashMap$HashIterator.remove(HashMap.java:801)
      1 frame
    3. net.sf.hibernate
      Hibernate.initialize
      1. net.sf.hibernate.impl.SessionImpl.endLoadingCollections(SessionImpl.java:2973)
      2. net.sf.hibernate.loader.Loader.doResultSet(Loader.java:224)
      3. net.sf.hibernate.loader.Loader.doFind(Loader.java:113)
      4. net.sf.hibernate.loader.Loader.loadCollection(Loader.java:720)
      5. net.sf.hibernate.loader.Loader.loadCollection(Loader.java:703)
      6. net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:74)
      7. net.sf.hibernate.impl.SessionImpl.initialize(SessionImpl.java:3101)
      8. net.sf.hibernate.collection.PersistentCollection.forceLoad(PersistentCollection.java:236)
      9. net.sf.hibernate.Hibernate.initialize(Hibernate.java:255)
      9 frames
    4. com.intrasoft.persistence
      HibernatePersistenceService.initialize
      1. com.intrasoft.persistence.hibernate.HibernatePersistenceService.initialize(HibernatePersistenceService.java:143)
      1 frame
    5. com.intrasoft.sysaudit
      MissionStep1.doExecute
      1. com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.initializeMission(AbstractMissionStepAction.java:112)
      2. com.intrasoft.sysaudit.mission.action.wizard.AbstractMissionStepAction.saveMissionInSession(AbstractMissionStepAction.java:74)
      3. com.intrasoft.sysaudit.mission.action.wizard.MissionStep1.doExecute(MissionStep1.java:173)
      3 frames
    6. XWork Tiger Extensions
      ActionSupport.execute
      1. com.opensymphony.xwork.ActionSupport.execute(ActionSupport.java:31)
      1 frame