Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2112

NodeNotFoundException While Doing Restore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 3.7.0.Final
    • 3.6.0.Final
    • None
    • None
    • Hide
              Session session
              VersionManager versionManager
              Node root
      
              // Add a page node with one child then make a version 1.0
              session = repositoryService.session
              versionManager = session.workspace.versionManager
              root = session.rootNode
              Node node = root.addNode(NODE_NAME, "jj:page")
              // first add '_context' and then 'child', this is important to reproduce this issue
              node.addNode('_context', 'jj:context')
              node.addNode('child', 'jj:content')
              session.save()
              versionManager.checkpoint(node.path)
      
              // do move
              session.move("/${NODE_NAME}/child", "/${NODE_NAME}/_context/child")
              session.save()
              // restore to 1.0, it will throw the NodeNotFoundException
              versionManager.restore("/${NODE_NAME}", "1.0", true)
              session.logout()
      
      Show
      Session session VersionManager versionManager Node root // Add a page node with one child then make a version 1.0 session = repositoryService.session versionManager = session.workspace.versionManager root = session.rootNode Node node = root.addNode(NODE_NAME, "jj:page" ) // first add '_context' and then 'child' , this is important to reproduce this issue node.addNode( '_context' , 'jj:context' ) node.addNode( 'child' , 'jj:content' ) session.save() versionManager.checkpoint(node.path) // do move session.move( "/${NODE_NAME}/child" , "/${NODE_NAME}/_context/child" ) session.save() // restore to 1.0, it will throw the NodeNotFoundException versionManager.restore( "/${NODE_NAME}" , "1.0" , true ) session.logout()

      This bug more or less the same as https://issues.jboss.org/browse/MODE-2104 which i fired previously. And lies on the child nodes order while adding.

      Exception: org.modeshape.jcr.cache.NodeNotFoundException
      Full stacktrace:

       Line | Method
      ->> 1143 | reorderChild in org.modeshape.jcr.cache.document.SessionNode
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |   1324 | restoreNode  in org.modeshape.jcr.JcrVersionManager$RestoreCommand
      |   1116 | execute . .  in     ''
      |    894 | restore      in org.modeshape.jcr.JcrVersionManager
      |    685 | restore . .  in     ''
      |     35 | testVersion  in VersionService.groovy
      |      8 | testVersion  in VersionController.groovy
      |    195 | doFilter     in PageFragmentCachingFilter.java
      |     63 | doFilter . . in AbstractFilter.java
      |   1145 | runWorker    in java.util.concurrent.ThreadPoolExecutor
      |    615 | run . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
      ^    722 | run          in java.lang.Thread
      
      

              hchiorean Horia Chiorean (Inactive)
              angelo.chen Angelo Chen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: