Directory ApacheDS
  1. Directory ApacheDS
  2. DIRSERVER-964

Binding does not return DirContext Object's when creating by doing ctx.createSubcontext("cn=test");

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      See test. I expect assertNull(binding.getObject()); to fail, but it passes. If I manually attempt to lookup the DirContext that the same DirContext instance, I get a real directory context.

      1. SelfContainedBindingTest.java
        5 kB
        Emmanuel Lecharny
      2. SelfContainedBindingTest.java
        6 kB
        Ole Ersoy

        Activity

        Hide
        Pierre-Arnaud Marcelot added a comment -

        Moving issue to 2.0.0-RC1.

        Show
        Pierre-Arnaud Marcelot added a comment - Moving issue to 2.0.0-RC1.
        Hide
        Emmanuel Lecharny added a comment -

        I think there is no problem, and even if there were one, it's now dead buried...

        Show
        Emmanuel Lecharny added a comment - I think there is no problem, and even if there were one, it's now dead buried...
        Hide
        Ole Ersoy added a comment -

        Strange. I bumped my apache-core dependency to 1.5.0 and then tried running your test Emmanuel (After closing eclipse and then opening again). Now I get this exceptionN:

        java.lang.NoSuchMethodError: org.apache.directory.server.core.configuration.MutableStartupConfiguration.setPartitionConfigurations(Ljava/util/Set;)V
        at org.apache.tuscany.das.ldap.selfcontained.test.SelfContainedBindingTest.createDASPartition(SelfContainedBindingTest.java:152)
        at org.apache.tuscany.das.ldap.selfcontained.test.SelfContainedBindingTest.setUp(SelfContainedBindingTest.java:32)

        Are you using this dependency?

        <dependency>
        <groupId>org.apache.directory.server</groupId>
        <artifactId>apacheds-core</artifactId>
        <version>1.5.0</version>
        </dependency>

        I tried running eclipse:clean eclipse:eclipse and I still get the same exception.

        Thanks,

        • Ole
        Show
        Ole Ersoy added a comment - Strange. I bumped my apache-core dependency to 1.5.0 and then tried running your test Emmanuel (After closing eclipse and then opening again). Now I get this exceptionN: java.lang.NoSuchMethodError: org.apache.directory.server.core.configuration.MutableStartupConfiguration.setPartitionConfigurations(Ljava/util/Set;)V at org.apache.tuscany.das.ldap.selfcontained.test.SelfContainedBindingTest.createDASPartition(SelfContainedBindingTest.java:152) at org.apache.tuscany.das.ldap.selfcontained.test.SelfContainedBindingTest.setUp(SelfContainedBindingTest.java:32) Are you using this dependency? <dependency> <groupId>org.apache.directory.server</groupId> <artifactId>apacheds-core</artifactId> <version>1.5.0</version> </dependency> I tried running eclipse:clean eclipse:eclipse and I still get the same exception. Thanks, Ole
        Hide
        Emmanuel Lecharny added a comment -

        Attached a test which works well.

        I there still a pb ?

        Show
        Emmanuel Lecharny added a comment - Attached a test which works well. I there still a pb ?
        Hide
        Emmanuel Lecharny added a comment -

        I have changed the test to use :
        configuration.setPartitionConfigurations( partitions );

        now, I have another pb : it's not a selfcontained test. I have to launch ADS beside the test in order to make it happy. It would be better and easier to fgollow thes tests in server-unit for such self-contained tests.

        ok, when I launch ADS beside, here is what I get :
        org.apache.directory.shared.ldap.exception.LdapSchemaViolationException: Attribute cn not declared in objectClasses of entry cn=L0,ou=test
        at org.apache.directory.server.core.schema.SchemaService.assertAllAttributesAllowed(SchemaService.java:1767)
        at org.apache.directory.server.core.schema.SchemaService.check(SchemaService.java:1704)
        at org.apache.directory.server.core.schema.SchemaService.add(SchemaService.java:1722)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.operational.OperationalAttributeService.add(OperationalAttributeService.java:171)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.exception.ExceptionService.add(ExceptionService.java:205)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.interceptor.BaseInterceptor.add(BaseInterceptor.java:100)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.authz.AuthorizationService.add(AuthorizationService.java:411)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.referral.ReferralService.add(ReferralService.java:292)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.authn.AuthenticationService.add(AuthenticationService.java:213)
        at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:117)
        at org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:698)
        at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:352)
        at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:340)
        at org.apache.directory.server.core.jndi.ServerContext.createSubcontext(ServerContext.java:328)
        at org.apache.directory.server.core.jndi.ServerContext.createSubcontext(ServerContext.java:305)
        at javax.naming.InitialContext.createSubcontext(InitialContext.java:464)
        at SelfContainedBindingTest.testNullBinding(SelfContainedBindingTest.java:99)
        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:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

        You have to use createSubContext( Name, Attributes )

        Show
        Emmanuel Lecharny added a comment - I have changed the test to use : configuration.setPartitionConfigurations( partitions ); now, I have another pb : it's not a selfcontained test. I have to launch ADS beside the test in order to make it happy. It would be better and easier to fgollow thes tests in server-unit for such self-contained tests. ok, when I launch ADS beside, here is what I get : org.apache.directory.shared.ldap.exception.LdapSchemaViolationException: Attribute cn not declared in objectClasses of entry cn=L0,ou=test at org.apache.directory.server.core.schema.SchemaService.assertAllAttributesAllowed(SchemaService.java:1767) at org.apache.directory.server.core.schema.SchemaService.check(SchemaService.java:1704) at org.apache.directory.server.core.schema.SchemaService.add(SchemaService.java:1722) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.operational.OperationalAttributeService.add(OperationalAttributeService.java:171) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.exception.ExceptionService.add(ExceptionService.java:205) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.interceptor.BaseInterceptor.add(BaseInterceptor.java:100) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.authz.AuthorizationService.add(AuthorizationService.java:411) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.referral.ReferralService.add(ReferralService.java:292) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.authn.AuthenticationService.add(AuthenticationService.java:213) at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142) at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:117) at org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:698) at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:352) at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:340) at org.apache.directory.server.core.jndi.ServerContext.createSubcontext(ServerContext.java:328) at org.apache.directory.server.core.jndi.ServerContext.createSubcontext(ServerContext.java:305) at javax.naming.InitialContext.createSubcontext(InitialContext.java:464) at SelfContainedBindingTest.testNullBinding(SelfContainedBindingTest.java:99) 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:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) You have to use createSubContext( Name, Attributes )
        Hide
        Emmanuel Lecharny added a comment -

        Hi,

        the test does not compile :
        configuration.setContextPartitionConfigurations( partitions );
        does not exist.

        Which version of ADS are you using ?

        Show
        Emmanuel Lecharny added a comment - Hi, the test does not compile : configuration.setContextPartitionConfigurations( partitions ); does not exist. Which version of ADS are you using ?
        Hide
        Ole Ersoy added a comment -

        I'm just going intuition for this. The following asserts pass:

        assertEquals("cn=L1,cn=L0,ou=test", binding.getName());
        assertFalse(binding.isRelative());

        To me it seems like this should pass:

        assertEquals("cn=L1", binding.getName());
        assertTrue(binding.isRelative());

        It seems like binding.getName() is returning what binding.getNameInNamespace() should return. It also seems like binding.isRelative() should be true, since the object the binding should contain should be a DirContext instance that is relative to L0.

        Show
        Ole Ersoy added a comment - I'm just going intuition for this. The following asserts pass: assertEquals("cn=L1,cn=L0,ou=test", binding.getName()); assertFalse(binding.isRelative()); To me it seems like this should pass: assertEquals("cn=L1", binding.getName()); assertTrue(binding.isRelative()); It seems like binding.getName() is returning what binding.getNameInNamespace() should return. It also seems like binding.isRelative() should be true, since the object the binding should contain should be a DirContext instance that is relative to L0.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ole Ersoy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development