java.util.ConcurrentModificationException

Sakai JIRA | Pascal-Nicolas Becker | 8 months ago
  1. 0

    Create a group and a user. Add the Group to the user, click update. Remove the user from the group and click update again. This creates a Internal Server Error and the Exception below. I tested this also with a group containing multiple EPersons to ensure that it does not happen only if you remove the last EPerson. WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=BDA8FE41865957615FD09134CA9FFF89:internal_error:-- URL Was: http://localhost:8080/dspace6/tools/group-edit -- Method: POST -- Parameters were: -- group_name: "SpecialUsers" -- submit_group_update: "Update Group" -- group_id: "75884951-b3f8-4e4c-8ddf-2d176dc73c7e" java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) at java.util.ArrayList$Itr.next(ArrayList.java:831) at org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810) at org.dspace.app.webui.servlet.admin.GroupEditServlet.doDSPost(GroupEditServlet.java:154) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

    Sakai JIRA | 8 months ago | Pascal-Nicolas Becker
    java.util.ConcurrentModificationException
  2. 0

    Create a group and a user. Add the Group to the user, click update. Remove the user from the group and click update again. This creates a Internal Server Error and the Exception below. I tested this also with a group containing multiple EPersons to ensure that it does not happen only if you remove the last EPerson. WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=BDA8FE41865957615FD09134CA9FFF89:internal_error:-- URL Was: http://localhost:8080/dspace6/tools/group-edit -- Method: POST -- Parameters were: -- group_name: "SpecialUsers" -- submit_group_update: "Update Group" -- group_id: "75884951-b3f8-4e4c-8ddf-2d176dc73c7e" java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) at java.util.ArrayList$Itr.next(ArrayList.java:831) at org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810) at org.dspace.app.webui.servlet.admin.GroupEditServlet.doDSPost(GroupEditServlet.java:154) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

    Sakai JIRA | 8 months ago | Pascal-Nicolas Becker
    java.util.ConcurrentModificationException
  3. 0

    When running the AIP ingest in "replace" mode (-r), the RoleIngester throws a ConcurrentModificationException. For example: ./dspace packager -r -a -f -t AIP -e myuser@myu.edu -i 10673/0 -o skipIfParentMissing=true -o createMetadataFields=true /vagrant /content/SITE@10673-0.zip Throws: java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) at java.util.ArrayList$Itr.next(ArrayList.java:831) at org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810) at org.dspace.content.packager.RoleIngester.ingestDocument(RoleIngester.java:263) at org.dspace.content.packager.RoleIngester.ingest(RoleIngester.java:492) at org.dspace.content.crosswalk.RoleCrosswalk.ingest(RoleCrosswalk.java:336) at org.dspace.content.crosswalk.RoleCrosswalk.ingest(RoleCrosswalk.java:258) at org.dspace.content.packager.METSManifest.crosswalkXmd(METSManifest.java:1193) at org.dspace.content.packager.METSManifest.crosswalkObjectOtherAdminMD(METSManifest.java:1106) at org.dspace.content.packager.AbstractMETSIngester.replaceObject(AbstractMETSIngester.java:650) at org.dspace.content.packager.AbstractMETSIngester.replace(AbstractMETSIngester.java:1207) at org.dspace.content.packager.AbstractPackageIngester.replaceAll(AbstractPackageIngester.java:282) at org.dspace.app.packager.Packager.replace(Packager.java:737) at org.dspace.app.packager.Packager.main(Packager.java:377) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:227) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:79) Here's the location of the error: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/packager/RoleIngester.java#L263 The fix is to change the "for" loops into "while" loops using Iterator to avoid the ConcurrentModificationException similar to this previous fix: https://github.com/DSpace/DSpace/commit/0cc6ca8c99f9a198cdd134a47aafde10b3cb087d and https://github.com/DSpace/DSpace/commit/09270f922f366fa48da68424a944f4df5366a229 PR will be coming shortly.

    Sakai JIRA | 1 year ago | Tim Donohue
    java.util.ConcurrentModificationException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When running the AIP ingest in "replace" mode (-r), the RoleIngester throws a ConcurrentModificationException. For example: ./dspace packager -r -a -f -t AIP -e myuser@myu.edu -i 10673/0 -o skipIfParentMissing=true -o createMetadataFields=true /vagrant /content/SITE@10673-0.zip Throws: java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) at java.util.ArrayList$Itr.next(ArrayList.java:831) at org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810) at org.dspace.content.packager.RoleIngester.ingestDocument(RoleIngester.java:263) at org.dspace.content.packager.RoleIngester.ingest(RoleIngester.java:492) at org.dspace.content.crosswalk.RoleCrosswalk.ingest(RoleCrosswalk.java:336) at org.dspace.content.crosswalk.RoleCrosswalk.ingest(RoleCrosswalk.java:258) at org.dspace.content.packager.METSManifest.crosswalkXmd(METSManifest.java:1193) at org.dspace.content.packager.METSManifest.crosswalkObjectOtherAdminMD(METSManifest.java:1106) at org.dspace.content.packager.AbstractMETSIngester.replaceObject(AbstractMETSIngester.java:650) at org.dspace.content.packager.AbstractMETSIngester.replace(AbstractMETSIngester.java:1207) at org.dspace.content.packager.AbstractPackageIngester.replaceAll(AbstractPackageIngester.java:282) at org.dspace.app.packager.Packager.replace(Packager.java:737) at org.dspace.app.packager.Packager.main(Packager.java:377) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:227) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:79) Here's the location of the error: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/packager/RoleIngester.java#L263 The fix is to change the "for" loops into "while" loops using Iterator to avoid the ConcurrentModificationException similar to this previous fix: https://github.com/DSpace/DSpace/commit/0cc6ca8c99f9a198cdd134a47aafde10b3cb087d and https://github.com/DSpace/DSpace/commit/09270f922f366fa48da68424a944f4df5366a229 PR will be coming shortly.

    Sakai JIRA | 1 year ago | Tim Donohue
    java.util.ConcurrentModificationException
  6. 0

  1. Shadd518 2 times, last 4 months ago
  2. serious2monkeys 2 times, last 1 month ago
  3. eti22 4 times, last 2 months ago
  4. Tahir 1 times, last 4 months ago
  5. haerick 1 times, last 6 months ago
5 more registered users
23 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.ArrayList$Itr.checkForComodification()
  2. Java RT
    ArrayList$Itr.next
    1. java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
    2. java.util.ArrayList$Itr.next(ArrayList.java:831)
    2 frames
  3. Hibernate
    AbstractPersistentCollection$IteratorProxy.next
    1. org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810)
    1 frame
  4. org.dspace.app
    DSpaceServlet.doPost
    1. org.dspace.app.webui.servlet.admin.GroupEditServlet.doDSPost(GroupEditServlet.java:154)
    2. org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122)
    3. org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80)
    3 frames
  5. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    2. javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    2 frames
  6. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  7. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  8. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  9. org.dspace.app
    RegisteredOnlyFilter.doFilter
    1. org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66)
    1 frame
  10. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  11. DSpace Services Framework :: API and Implementation
    DSpaceWebappServletFilter.doFilter
    1. org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78)
    1 frame
  12. Glassfish Core
    StandardHostValve.invoke
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    6 frames
  13. com.googlecode.psiprobe
    Tomcat70AgentValve.invoke
    1. com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)
    1 frame
  14. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    2. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    3. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    4. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    4 frames
  15. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    3 frames
  16. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    2 frames
  17. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    1 frame
  18. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame