Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1083

Node copy with :replace fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • Servlets Post 2.0.2
    • Servlets Post 2.1.0
    • Servlets
    • None
    • J2SE 1.6.0_14-b08, Debian Linux

    Description

      Attempting to copy a node to the location of an existing node fails with a PathNotFoundException, generated by the call to session.getItem() at line 136 of AbstractMoveCopyOperation.java. The attached script demonstrates the failure.

      By introducing a breakpoint in CopyOperation.java's copy(Node src, Node dstParent, String name) anywhere after the replacement node is created (line 109), I've been able to make requests succeed. It seems as though there must be a race or a caching issue there.

      Stack trace:
      13.08.2009 13:16:10.374 ERROR [127.0.0.1 [1250165770368] POST /d1 HTTP/1.1] org.apache.sling.servlets.post.impl.operations.CopyOperation Exception during response processing. javax.jcr.PathNotFoundException: /d2
      at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:442)
      at org.apache.jackrabbit.core.SessionImpl.getItem(SessionImpl.java:805)
      at org.apache.sling.jcr.base.internal.PooledSession.getItem(PooledSession.java:158)
      at org.apache.sling.servlets.post.impl.operations.AbstractCopyMoveOperation.doRun(AbstractCopyMoveOperation.java:136)
      at org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:87)
      at org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:172)
      at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:143)
      at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:338)
      at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:369)
      at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:520)
      at org.apache.sling.engine.impl.SlingMainServlet.processRequest(SlingMainServlet.java:409)
      at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:48)
      at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:59)
      at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)
      at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:57)
      at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:296)
      at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:183)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
      at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
      at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:324)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

      Attachments

        1. test-replace.sh
          0.3 kB
          Arthur Taylor

        Activity

          People

            ianeboston Ian Boston
            codders Arthur Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: