Bug 1170359 - [GSS](6.4.x) InitialContext re-wrapping specific NamingExceptions with more generic NamingException
Summary: [GSS](6.4.x) InitialContext re-wrapping specific NamingExceptions with more g...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Naming
Version: 6.2.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DR13
: EAP 6.4.0
Assignee: emartins
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1171243
TreeView+ depends on / blocked
 
Reported: 2014-12-03 21:31 UTC by Brad Maxwell
Modified: 2019-08-19 12:43 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 1171243 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-4149 0 Major Closed NamingExceptions not properly handled in InitialContext 2018-07-10 20:38:43 UTC

Comment 3 Brad Maxwell 2014-12-05 18:05:10 UTC
Change in InitialContext caused AuthenticationException to be wrapped with a more generic NamingException causing application issues: 

INFO  [org.springframework.ldap.core.LdapTemplate] (http-/192.168.1.101:8543-3) Authentication failed for entry with DN 'uid=d1234567,ou=abcde,ou=us,ou=redhat,ou=customers,dc=jboss
,dc=com': org.springframework.ldap.UncategorizedLdapException: Uncategorized exception occured during LDAP processing; nested exception is javax.naming.NamingException: JBAS011843: Failed instan
tiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "deployment.example.war:main" from Service Module Loader [Root exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]]
        at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:228) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
        at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:347) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
        at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:131) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
        at org.springframework.ldap.core.support.AbstractContextSource.getContext(AbstractContextSource.java:122) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
        at org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy.getContext(TransactionAwareContextSourceProxy.java:98) [spring-ldap-core-2.0.0.RELEASE.jar
:2.0.0.RELEASE]
        at org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1454) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
...
Caused by: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "deployment.example.war:m
ain" from Service Module Loader [Root exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]]
        at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:124)
        at org.jboss.as.naming.InitialContext.init(InitialContext.java:107)
        at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:153) [rt.jar:1.7.0_65]
        at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:98)
        at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:44)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) [rt.jar:1.7.0_65]
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307) [rt.jar:1.7.0_65]
        at javax.naming.InitialContext.init(InitialContext.java:242) [rt.jar:1.7.0_65]
        at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:153) [rt.jar:1.7.0_65]
        at org.springframework.ldap.core.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:42) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
        at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:335) [spring-ldap-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
        ... 83 more
Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:316) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154) [rt.jar:1.7.0_65]
        at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84) [rt.jar:1.7.0_65]
        at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:122)
        ... 93 more

Comment 5 Jan Martiska 2014-12-10 12:15:17 UTC
Verified in EAP 6.4.0.DR13.


Note You need to log in before you can comment on or make changes to this bug.