Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-869

Runtime exception while adding node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.12
    • jcr
    • None

    Description

      Trying to add a node where the user has not read permission ends up in a runtime exception

      java.lang.IllegalStateException: This tree does not exist
      at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
      at org.apache.jackrabbit.oak.core.TreeImpl.checkExists(TreeImpl.java:453)
      at org.apache.jackrabbit.oak.core.TreeImpl.setProperty(TreeImpl.java:347)
      at org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.internalAddChild(NodeDelegate.java:508)
      at org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.addChild(NodeDelegate.java:462)
      at org.apache.jackrabbit.oak.jcr.NodeImpl$5.perform(NodeImpl.java:256)
      at org.apache.jackrabbit.oak.jcr.NodeImpl$5.perform(NodeImpl.java:1)
      at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:97)
      at org.apache.jackrabbit.oak.jcr.ItemImpl.perform(ItemImpl.java:95)
      at org.apache.jackrabbit.oak.jcr.NodeImpl.addNode(NodeImpl.java:217)
      at org.apache.jackrabbit.oak.jcr.NodeImpl.addNode(NodeImpl.java:203)
      at org.apache.jackrabbit.oak.benchmark.AddChildTest.runTest(AddChildTest.java:71)
      at org.apache.jackrabbit.oak.benchmark.AbstractTest.execute(AbstractTest.java:146)
      at org.apache.jackrabbit.oak.benchmark.AddChildTest.execute(AddChildTest.java:1)
      at org.apache.jackrabbit.oak.benchmark.AbstractTest.runTest(AbstractTest.java:115)
      at org.apache.jackrabbit.oak.benchmark.AbstractTest.run(AbstractTest.java:84)
      at org.apache.jackrabbit.oak.benchmark.AddChildTest.run(AddChildTest.java:1)
      at org.apache.jackrabbit.oak.benchmark.BenchmarkRunner.main(BenchmarkRunner.java:114)

      It would be better to have a checked excpetion instead e.g. javax.jcr.AccessDeniedException

      I will attach test to reproduce the issue

      Attachments

        1. AddChildTest.java
          3 kB
          Antonio Sanso

        Issue Links

          Activity

            People

              jukkaz Jukka Zitting
              asanso Antonio Sanso
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: