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

Runtime exception while creating a group

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9
    • core
    • None

    Description

      Trying to create a group where the user has not 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.MutableTree.checkExists(MutableTree.java:381)
      	at org.apache.jackrabbit.oak.core.MutableTree.setProperty(MutableTree.java:298)
      	at org.apache.jackrabbit.oak.util.NodeUtil.setName(NodeUtil.java:226)
      	at org.apache.jackrabbit.oak.util.NodeUtil.addChild(NodeUtil.java:108)
      	at org.apache.jackrabbit.oak.util.NodeUtil.getOrAddChild(NodeUtil.java:115)
      	at org.apache.jackrabbit.oak.security.user.UserProvider.createFolderNodes(UserProvider.java:280)
      	at org.apache.jackrabbit.oak.security.user.UserProvider.createAuthorizableNode(UserProvider.java:247)
      	at org.apache.jackrabbit.oak.security.user.UserProvider.createGroup(UserProvider.java:185)
      	at org.apache.jackrabbit.oak.security.user.UserManagerImpl.createGroup(UserManagerImpl.java:188)
      	at org.apache.jackrabbit.oak.security.user.UserManagerImpl.createGroup(UserManagerImpl.java:166)
      	at org.apache.jackrabbit.oak.jcr.security.authorization.UserManagementTest.testCreateGroup3(UserManagementTest.java:170)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at junit.framework.TestCase.runTest(TestCase.java:168)
      	at junit.framework.TestCase.runBare(TestCase.java:134)
      	at junit.framework.TestResult$1.protect(TestResult.java:110)
      	at junit.framework.TestResult.runProtected(TestResult.java:128)
      	at junit.framework.TestResult.run(TestResult.java:113)
      	at junit.framework.TestCase.run(TestCase.java:124)
      	at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:464)
      	at junit.framework.TestSuite.runTest(TestSuite.java:243)
      	at junit.framework.TestSuite.run(TestSuite.java:238)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      
      
      

      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. OAK-923-patch.txt
          14 kB
          Antonio Sanso
        2. OAK-923-test.txt
          0.9 kB
          Antonio Sanso
        3. OAK-923-test.txt
          0.9 kB
          Antonio Sanso

        Issue Links

          Activity

            People

              angela Angela Schreiber
              asanso Antonio Sanso
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: