Я использую DirContext для подключения к серверу LDAP.Как получить информацию об ошибках этого контекста?Сервер недоступен, пароль неверный или пользователь заблокирован и т. Д.
Hashtable<String, String> envoironment = new Hashtable<>();
envoironment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
// envoironment.put(Context.PROVIDER_URL, "******");
envoironment.put(Context.PROVIDER_URL, "******");
envoironment.put(Context.SECURITY_AUTHENTICATION,
"simple");
envoironment.put(Context.SECURITY_PRINCIPAL, username
+ "@somdomain.com");
envoironment.put(Context.SECURITY_CREDENTIALS,
password);
DirContext context = new InitialDirContext(envoironment);