Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-1872

javax.jcr.ItemExistsException returns a 500 and stack trace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: Fedora 4.4.0
    • Fix Version/s: None
    • Component/s: f4-core
    • Labels:
      None
    • Sprint:
      Sprint 2015 - 13

      Description

      See: https://github.com/fcrepo4/fcrepo4/issues/957

      It should be caught and a 4xx should be returned instead.

      ```
      STATUS: 500 javax.jcr.ItemExistsException: A node definition that allows same name siblings could not be found for the node "{}42" in workspace "default"
      at org.modeshape.jcr.JcrSession$JcrPreSave.processAfterLocking(JcrSession.java:2422)
      at org.modeshape.jcr.cache.document.WritableSessionCache.runPreSaveAfterLocking(WritableSessionCache.java:541)
      at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:614)
      at org.modeshape.jcr.JcrSession.save(JcrSession.java:1166)
      at org.fcrepo.http.api.FedoraLdp.createOrReplaceObjectRdf(FedoraLdp.java:301)
      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.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java...
      ```

      I think this occurs when two threads simultaneously try to create the same resource at the same time. Reported by @ojlyytinen here: https://github.com/projecthydra/sufia/issues/1362

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              justin Justin Coyne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: