private boolean pingLDAP(StringBuilder sb) { Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, url); if (url != null && url.startsWith(LDAPS_URL)) { env.put(LDAP_SOCKET_FACTORY, DEFAULT_SSL_LDAP_SOCKET_FACTORY); } try { new InitialContext(env); appendNL(sb,lsm.getString("ldap.ok", url)); return true; } catch (AuthenticationNotSupportedException anse) { //CR 6944776 //If the server throws this error, it is up //and is configured with Anonymous bind disabled. //Ignore this error while configuring ldap for admin appendNL(sb,lsm.getString("ldap.ok", url)); return true; } catch(Exception e) { appendNL(sb,lsm.getString("ldap.na", url, e.getClass().getName(), e.getMessage())); logger.info(StringUtils.getStackTrace(e)); return false; } }
whackee, ioe, StringUtils.getStackTrace(ioe)));