@Override public SecurityChallenge getUserSecurityChallenge(String username) { for (LdapServer server : ldapServers) { try { SecurityChallenge challenge = server.getUserSecurityChallenge(username); if (logger.isDebugEnabled()) { if (challenge != null) { logger.debug( "Successfully got security challenge for " + username + " at " + server.getDescription()); } else { logger.debug( "Got null security challenge for " + username + " at " + server.getDescription()); } } return challenge; } catch (NameNotFoundException ex) { logger.debug("Didn't find " + username + " in " + server.getDescription()); // ignore it... try the next server } catch (ObjectRetrievalException ex) { logger.debug("Multiple results found for " + username); // ignore it... try the next server } } throw new NameNotFoundException( "Couldn't find username " + username + " in any of provided servers."); }