Hey Guys,

I'm wondering whether the LdapContext.destroySubcontext() method is working 
properly?  I have some code like this:
===================================================================================
String destroyedObjectRelativeDN = 
dataObjectToRelativeDNCache.get(destroyedObject);
LdapContext destroyedContext = (LdapContext) containerContext.lookup(destroyedObjectRelativeDN);

System.out.println(destroyedContext.getNameInNamespace());
===================================================================================

If I run this I get what I expect, which is:
===================================================================================
example-com-users-accounts-Authorization-id=2,cn=authorizationList,example-com-users-accounts-User-id=1,cn=accounts,cn=users,cn=example,cn=com,ou=das
example-com-users-accounts-Authorization-id=3,cn=authorizationList,example-com-users-accounts-User-id=1,cn=accounts,cn=users,cn=example,cn=com,ou=das
example-com-users-accounts-Configuration-id=5,cn=configuration,example-com-users-accounts-User-id=1,cn=accounts,cn=users,cn=example,cn=com,ou=das
===================================================================================

So the container context is able to lookup all the contexts that it should be 
able to lookup.  However if I change the code and ask it to destroy these 
contexts like this:

containerContext.destroySubcontext(destroyedObjectRelativeDN);

I get an exception like this:
==========================================================================================================
org.apache.directory.shared.ldap.exception.LdapNameNotFoundException: Attempt 
to lookup non-existant entry: 
example-com-users-accounts-authorization-id=2,2.5.4.3=authorizationlist,example-com-users-accounts-user-id=1,2.5.4.3=accounts,2.5.4.3=users,2.5.4.3=example,2.5.4.3=com,2.5.4.11=das
        at 
org.apache.directory.server.core.exception.ExceptionService.assertHasEntry(ExceptionService.java:573)
        at 
org.apache.directory.server.core.exception.ExceptionService.lookup(ExceptionService.java:292)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain.lookup(InterceptorChain.java:848)
at
This seems off, since we know that this entry really does exist....

Thoughts?

Thanks,
- Ole



Reply via email to