Christan Keller created OAK-1002:
------------------------------------

             Summary: JackrabbitAccessControlList.addEntry() thwos 
NoSuchMethodError
                 Key: OAK-1002
                 URL: https://issues.apache.org/jira/browse/OAK-1002
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: security
    Affects Versions: 0.8
            Reporter: Christan Keller


Trying to add an Entry to an Acl throws a NoSuchMethodError.

I have guava 14.0.1 in my classpath

{noformat}
java.lang.NoSuchMethodError: 
com.google.common.collect.Maps.valueIterator(Lcom/google/common/collect/UnmodifiableIterator;)Lcom/google/common/collect/UnmodifiableIterator;
        at 
com.google.common.collect.ImmutableMapValues.iterator(ImmutableMapValues.java:46)
        at 
com.google.common.collect.ImmutableMapValues.iterator(ImmutableMapValues.java:31)
        at 
com.google.common.collect.ObjectArrays.fillArray(ObjectArrays.java:172)
        at 
com.google.common.collect.ObjectArrays.toArrayImpl(ObjectArrays.java:167)
        at 
com.google.common.collect.ImmutableCollection.toArray(ImmutableCollection.java:58)
        at 
com.google.common.collect.ImmutableSet.copyFromCollection(ImmutableSet.java:381)
        at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:376)
        at 
org.apache.jackrabbit.oak.spi.security.authorization.restriction.AbstractRestrictionProvider.getSupportedRestrictions(AbstractRestrictionProvider.java:59)
        at 
org.apache.jackrabbit.oak.security.authorization.accesscontrol.ACL.addEntry(ACL.java:104)
        at 
org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlList.addEntry(AbstractAccessControlList.java:132)
        at com.day.cq.wcm.msm.impl.Issue.testNoSuchMethodError(Issue.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
        at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{noformat}

Stepps to reproduce

{code}
    @Test
    public void testNoSuchMethodError() throws RepositoryException {
        Repository repo = new Jcr().createRepository();
        Session admin = repo.login(new SimpleCredentials("admin", 
"admin".toCharArray()), null);
        Node node = admin.getRootNode().addNode("lala", 
JcrConstants.NT_UNSTRUCTURED);
        admin.save();
        Principal adminPrincipal = ((JackrabbitSession) 
admin).getPrincipalManager().getPrincipal("admin");
        JackrabbitAccessControlList acl = 
AccessControlUtils.getAccessControlList(admin, node.getPath());
        acl.addEntry(adminPrincipal, 
AccessControlUtils.privilegesFromNames(admin, Privilege.JCR_ADD_CHILD_NODES), 
true);
    }
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to