JRuby/LDAP catches javax.naming.NamingException and reports "Can not connect to
LDAP Server" - even if it's an authentication error...
--------------------------------------------------------------------------------------------------------------------------------------
Key: JRUBY-1679
URL: http://jira.codehaus.org/browse/JRUBY-1679
Project: JRuby
Issue Type: Improvement
Components: JRuby-extras
Reporter: Daniel Wintschel
Attachments: conn.diff
I've been playing with JRuby/LDAP, and had a head-desk-smashing experience for
a while because I continuously received an error which was looking like this:
1) Error:
test_ldap_authentication(LdapAuthTest):
LDAP::ResultError: Can't contact LDAP server
/Users/daniel/usr/local/jruby-1.1b1/lib/ruby/gems/1.8/gems/jruby-ldap-0.0.1/lib/ldap/conn.rb:71:in
`bind'
test/unit/ldap_auth_test.rb:19:in `test_ldap_authentication'
I finally started tracing into the JRuby/LDAP code, and added some debug output
to see what was really going on... instead of catching
jacax.naming.AuthenticationException as one of the exceptions being handled, it
was defaulting to javax.naming.NamingException, and printing out "Can't contact
LDAP server" - when really it WAS contacting the LDAP server, it was just that
my credentials weren't correct.
I added an extra exception handling block into conn.rb, and tested again, and I
received the proper error message (authentication failure).
I've created a patch and attached it to this issue.
Let me know if any questions or issues.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email