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 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.
    via by Tim Donohue,
  • 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.
    via by Tim Donohue,
  • 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)
    via by Pascal-Nicolas Becker,
  • 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)
    via by Pascal-Nicolas Becker,
    • 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)

    Users with the same issue

    Shadd518Shadd518
    2 times, last one,
    haerickhaerick
    1 times, last one,
    davidvanlaatumdavidvanlaatum
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    51 more bugmates