|
Home > Archive > Apache Directory Project > July 2007 > [JNDI] LdapContext.destroyContext() Bug?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[JNDI] LdapContext.destroyContext() Bug?
|
|
| Ole Ersoy 2007-07-19, 7:11 pm |
| 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(destroyedObjectRelativ
eDN);
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
| |
| Emmanuel Lecharny 2007-07-20, 7:11 am |
| Hi Ole,
can you provide a full fonctionning tests exposing the incorrect behavior ?
Thanks !
On 7/19/07, Ole Ersoy <ole.ersoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hey Guys,
>
> I'm wondering whether the LdapContext.destroySubcontext() method is worki=
ng properly? I have some code like this:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
> String destroyedObjectRelativeDN =3D dataObjectToRelativeDNCache.get(dest=
royedObject);
> LdapContext destroyedContext =3D
> (LdapContext) containerContext.lookup(destroyedObjectRelativeDN);
>
> System.out.println(destroyedContext.getNameInNamespace());
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> If I run this I get what I expect, which is:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
> example-com-users-accounts-Authorization-id=3D2,cn=3DauthorizationList,ex=
ample-com-users-accounts-User- id=3D1,cn=3Daccounts,cn=3Dusers,cn=3Dexa
mple,=
cn=3Dcom,ou=3Ddas
> example-com-users-accounts-Authorization-id=3D3,cn=3DauthorizationList,ex=
ample-com-users-accounts-User- id=3D1,cn=3Daccounts,cn=3Dusers,cn=3Dexa
mple,=
cn=3Dcom,ou=3Ddas
> example-com-users-accounts-Configuration-id=3D5,cn=3Dconfiguration,exampl=
e-com-users-accounts-User- id=3D1,cn=3Daccounts,cn=3Dusers,cn=3Dexa
mple,cn=
=3Dcom,ou=3Ddas
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> So the container context is able to lookup all the contexts that it shoul=
d be able to lookup. However if I change the code and ask it to destroy th=
ese contexts like this:
>
> containerContext. destroySubcontext(destroyedObjectRelativ
eDN);
>
> I get an exception like this:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
> org.apache.directory.shared.ldap.exception.LdapNameNotFoundException: Att=
empt to lookup non-existant entry: example-com-users-accounts-authorization=
-id=3D2,2.5.4.3=3Dauthorizationlist,example-com-users-accounts-user-id=3D1,=
2.5.4.3=3Daccounts,2.5.4.3=3Dusers,2.5.4.3=3Dexample,2.5.4.3=3Dcom,2.5.4.11=
=3Ddas
> at org.apache.directory.server.core.exception.ExceptionService.as=
sertHasEntry(ExceptionService.java:573)
> at org.apache.directory.server.core.exception.ExceptionService.lo=
okup(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
>
>
>
>
--=20
Regards,
Cordialement,
Emmanuel L=E9charny
www.iktek.com
| |
| Ole Ersoy 2007-07-20, 7:11 pm |
| Hey Emmanuel,
Sorry - My bad. I looked a little more closely at the stack trace and discovered the exception was being thrown during tearDown(). Before I was just testing data graph reading and writing, thus tearing down all created dataobjects manually, and now I'm
testing the change summary processing, so I ended up attempting to delete objects that the change summary had already deleted.
Sorry for the noise,
- Ole
Emmanuel Lecharny wrote:
> Hi Ole,
>
> can you provide a full fonctionning tests exposing the incorrect behavior ?
>
> Thanks !
>
> On 7/19/07, Ole Ersoy <ole.ersoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
|
|
|
|
|