> public String findUniqueDN(String filter, LdapConnection con)
> throws Exception {
> String dn = null;
>
> Cursor<SearchResponse> cursor = null;
> try {
> cursor = con.search(baseDn, filter,
> SearchScope.SUBTREE, "*");
> if (cursor.next()) {
> dn = getDN(cursor);
> if (cursor.next()) {
> logger.warn("several entries matched "
> + filter + " in "
> + baseDn);
> dn = null;
> }
> } else {
> logger.warn("nothing found matching " +
> filter);
> }
> } catch (Throwable e) {
> logger.error("error searching for " + filter, e);
> } finally {
> cleanUp(cursor);
> }
> return dn;
> }
>
> and a (uid=*) filter I can trigger the following output:
can you paste the code for your getDN() and cleanUp() methods too
Kiran Ayyagari