PDA

View Full Version : How to verify if a base is valid when Spring-LDAP ignores NameNotFoundException



guofeng
Apr 23rd, 2007, 01:24 AM
Because LdapTemplate.search() method silently ignored NameNotFoundException, so in our program we do not know if there is no entry in LDAP or the base is invalid when LdapTemplate.search() found nothing.

How to solve it?

Thanks

rasky
Apr 23rd, 2007, 01:26 AM
In order to verify the base DN you can do a lookup using that DN. That method will throw an exception if no entry is found.