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

Enabling versioning on Binary resource creation fails

    Details

      Description

      To reproduce:
      1. start up a container
      2. execute the following curl command.

      curl -v -XPOST -H "Content-Type: text/plain" -H "Slug: test-item" "http://localhost:8080/rest/" -H "Link: <http://fedora.info/definitions/fcrepo#VersionedResource>; rel=\"type\"" --data-binary "test"

      3. You will get something like this:
      nk: <http://fedora.info/definitions/fcrepo#VersionedResource>; rel=\"type\"" --data-binary "test"

      • Trying 127.0.0.1...
      • Connected to localhost (127.0.0.1) port 8080 (#0)
        > POST /rest/ HTTP/1.1
        > Host: localhost:8080
        > User-Agent: curl/7.43.0
        > Accept: /
        > Content-Type: text/plain
        > Slug: testxxx14
        > Link: <http://fedora.info/definitions/fcrepo#VersionedResource>; rel="type"
        > Content-Length: 4
        >
      • upload completely sent off: 4 out of 4 bytes
        < HTTP/1.1 500 Internal Server Error
        < Date: Thu, 05 Oct 2017 19:30:52 GMT
        < Content-Type: text/plain;charset=utf-8
        < Content-Length: 5925
        < Server: Jetty(9.3.1.v20150714)
        <
        javax.jcr.nodetype.ConstraintViolationException: Unable to add child 'TimeMap' with primary type 'nt:folder' to parent at /testxxx14 with primary type 'nt:file' and mixins ' {fedora:NonRdfSourceDescription,fedora:Resource}

        ' in workspace 'default' of repository 'repo' because:

      • child's name 'TimeMap' does not satisfy parent's child definition: nt:file/jcr:content (required primary types = [nt:base])
        at org.modeshape.jcr.NodeTypes$MatchResults.throwFailure(NodeTypes.java:2533)
        at org.modeshape.jcr.NodeTypes$AbstractNodeDefinitionSet.reasonNotMatched(NodeTypes.java:2600)
        at org.modeshape.jcr.NodeTypes$SingleNodeDefinitionSet.determineReasonForMismatch(NodeTypes.java:2900)
        at org.modeshape.jcr.AbstractJcrNode.validateChildNodeDefinition(AbstractJcrNode.java:1274)
        at org.modeshape.jcr.AbstractJcrNode.addChildNode(AbstractJcrNode.java:1126)
        at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:1074)
        at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:988)
        at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:102)
        at org.modeshape.jcr.api.JcrTools.findOrCreateNode(JcrTools.java:437)
        at org.modeshape.jcr.api.JcrTools.findOrCreateChild(JcrTools.java:477)
        at org.fcrepo.kernel.modeshape.FedoraResourceImpl.findOrCreateTimeMap(FedoraResourceImpl.java:379)
        at org.fcrepo.kernel.modeshape.FedoraResourceImpl.enableVersioning(FedoraResourceImpl.java:975)
        at org.fcrepo.kernel.modeshape.FedoraBinaryImpl.enableVersioning(FedoraBinaryImpl.java:454)
        at org.fcrepo.http.api.FedoraLdp.createObject(FedoraLdp.java:607)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1113)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1047)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
        at org.eclipse.jetty.server.Server.handle(Server.java:517)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:238)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:57)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

            People

            • Assignee:
              whikloj Jared Whiklo
              Reporter:
              dbernstein Danny Bernstein
              Reviewer:
              Andrew Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: