javax.naming.AuthenticationException being wrapped with javax.naming.NamingException starting in JBoss EAP 6.2 CP1
Issue
- In JBoss EAP 6.1, we were getting an AuthenticationException back, now in JBoss EAP 6.2 CP1 it has been wrapped with NamingException
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
Environment
Red Hat JBoss Enterprise Application Platform (EAP)
* 6.3.2
* 6.2.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
