@@ -72,6 +72,7 @@ public LdapConfigurationResponse addConfiguration(final String hostname, final i
7272 s_logger .info ("Added new ldap server with hostname: " + hostname );
7373 return new LdapConfigurationResponse (hostname , port );
7474 } catch (final NamingException e ) {
75+ s_logger .debug ("NamingException while doing an LDAP bind" , e );
7576 throw new InvalidParameterValueException ("Unable to bind to the given LDAP server" );
7677 }
7778 } else {
@@ -89,6 +90,7 @@ public boolean canAuthenticate(final String username, final String password) {
8990 closeContext (context );
9091 return true ;
9192 } catch (final NamingException e ) {
93+ s_logger .debug ("NamingException: while doing an LDAP bind for user " +" " +username , e );
9294 s_logger .info ("Failed to authenticate user: " + username + ". incorrect password." );
9395 return false ;
9496 }
@@ -100,7 +102,7 @@ private void closeContext(final DirContext context) {
100102 context .close ();
101103 }
102104 } catch (final NamingException e ) {
103- s_logger .warn (e .getMessage ());
105+ s_logger .warn (e .getMessage (), e );
104106 }
105107 }
106108
@@ -174,6 +176,7 @@ public List<LdapUser> getUsers() throws NoLdapUserMatchingQueryException {
174176 context = _ldapContextFactory .createBindContext ();
175177 return _ldapUserManager .getUsers (context );
176178 } catch (final NamingException e ) {
179+ s_logger .debug ("ldap NamingException: " ,e );
177180 throw new NoLdapUserMatchingQueryException ("*" );
178181 } finally {
179182 closeContext (context );
@@ -187,6 +190,7 @@ public List<LdapUser> getUsersInGroup(String groupName) throws NoLdapUserMatchin
187190 context = _ldapContextFactory .createBindContext ();
188191 return _ldapUserManager .getUsersInGroup (groupName , context );
189192 } catch (final NamingException e ) {
193+ s_logger .debug ("ldap NamingException: " ,e );
190194 throw new NoLdapUserMatchingQueryException ("groupName=" + groupName );
191195 } finally {
192196 closeContext (context );
@@ -214,6 +218,7 @@ public List<LdapUser> searchUsers(final String username) throws NoLdapUserMatchi
214218 final String escapedUsername = LdapUtils .escapeLDAPSearchFilter (username );
215219 return _ldapUserManager .getUsers ("*" + escapedUsername + "*" , context );
216220 } catch (final NamingException e ) {
221+ s_logger .debug ("ldap NamingException: " ,e );
217222 throw new NoLdapUserMatchingQueryException (username );
218223 } finally {
219224 closeContext (context );
0 commit comments