Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-2572

session.move() fails with mix:versionable nodes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0
    • None
    • jackrabbit-spi2dav
    • None

    Description

      Jackrabbit 2.0.0
      spi/davex stack

      I'm using the session.move() to move a node. In short, it works but when I add the mix:versionable mixin to my node types, it fails.

      Here's what I'm doing:

      **WITHOUT VERSIONABLE NODES**

      Assuming the following node structure:

      /a/b0

      I'm moving node /a/b0 to /a/b1 with the following API:

      session.move( "/a/b0, "/a/b1" );
      session.save();

      As long as my node types don't have mix:versionable, this works. Even when I move the node many times.

      **WITH VERSIONABLE NODES***

      Assuming again:

      /a/b0

      I'm moving node /a/b0 to /a/b1 with the following API:

      session.move( "/a/b0, "/a/b1" );
      session.save();

      This works the FIRST TIME. But if I do the following without restarting the application . . .

      Note: now the repo has:

      /a/b1

      Moving node /a/b1 to /a/b2 with the same API:

      session.move( "/a/b1, "/a/b2" );
      session.save();

      Throws "javax.jcr.PathNotFoundException: /a/b0"

      See how the path not found is pointing at the old path that DOES NOT EVEN EXIST anymore. This does smell of being connected to versioning, does it not?

      Here's my full stack trace ( with a bunch my own application's method invocations removed ):

      <I>Original exception:

      javax.jcr.PathNotFoundException: /BIP/1/1/doc0

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

      at java.lang.reflect.Constructor.newInstance(Constructor.java:501)

      at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:67)

      at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:49)

      at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:457)

      at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$200(RepositoryServiceImpl.java:399)

      at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:304)

      at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:830)

      at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$500(WorkspaceManager.java:797)

      at org.apache.jackrabbit.jcr2spi.WorkspaceManager.execute(WorkspaceManager.java:594)

      at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.save(SessionItemStateManager.java:139)

      at org.apache.jackrabbit.jcr2spi.ItemImpl.save(ItemImpl.java:246)

      at org.apache.jackrabbit.jcr2spi.SessionImpl.save(SessionImpl.java:328)

      at wego.ecms.WGContentRepositoryHelper.moveDocumentToNewName(WGContentRepositoryHelper.java:391)

      Attachments

        Activity

          People

            Unassigned Unassigned
            chadmichael chad davis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: