// Loop through each configured base DN. It may be useful
// in the future to allow for a filter to be configured for
// each BaseDN, but for now the filter will apply to all.
String[] baseDNs = baseDN.split(BASEDN_DELIMITER);
for (int x = 0; x < baseDNs.length; x++) {
NamingEnumeration answer = ctx.search(baseDNs[x], filter, searchControls);
boolean ldapApiNpeFound = false;
if (!answer.hasMoreElements()) {//BZ:582471- ldap api bug
log.debug("User " + userName + " not found for BaseDN " + baseDNs[x]);
// Nothing found for this DN, move to the next one if we have one.