Why destroySubcontext() gives error code 32 - No Such Object

Hi,

I use Java code to delete a user from SUN ONE directory, but keep getting error code 32 - No Such Object

[LDAP: error code 32 - No Such Object]

javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name ''

The code is simple:

.......

DirContext ctx = this.getDirContext();

ctx.destroySubcontext("uid="+username+","+SEARCHBASE_DN);

.......

the "uid="+username+","+SEARCHBASE_DN returns as uid=SKing,ou=People,dc=uchicago,dc=edu and I have enough privilege as cn=Directory Manager.

What went wrong here? Your help will be apprecaited,

[639 byte] By [DirBoy] at [2007-11-26 8:33:40]
# 1
So the question is if this ID really exists in your server? You can do an ldapsearch first.
sun_iplanet at 2007-7-6 21:59:42 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

Solution is simple...

Pls dont use SEARCH_DN in the API as it is already there in the context.

for example

your search dn is --> ou=test,ou=com and your entry is

uid=test,ou=users,ou=test,ou=com then in the API just pass uid=test,ou=users not the whole dn

thanks

idmguru at 2007-7-6 21:59:42 > top of Java-index,Web & Directory Servers,Directory Servers...