Results 1 to 2 of 2
  1. #1
    Patit Pawan is offline Member
    Join Date
    Jul 2014
    Posts
    5
    Rep Power
    0

    Default Error occured while configuring Active Director Ldap connection using Spring security

    Hi guys, i am getting this error while trying to authenticate username and password against windows Active directory using
    ActiveDirectoryLdapAuthenticationProvider class. If anybody has any idea please share it ........

    Versions

    <spring.security.version>3.2.0.RELEASE</spring.security.version>
    <spring.framework.version>4.0.1.RELEASE</spring.framework.version>

    Error:
    ----------------------------------


    14:40:35,786 ERROR [io.undertow.request] (default task-6) UT005023: Exception handling request to /eFin_iAnalytics/j_spring_security_check: java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.replaceEach(Lj ava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/String;
    at org.springframework.ldap.core.DistinguishedName.un mangleCompositeName(DistinguishedName.java:250) [spring-ldap-core-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.ldap.core.DistinguishedName.pa rse(DistinguishedName.java:217) [spring-ldap-core-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.ldap.core.DistinguishedName.<i nit>(DistinguishedName.java:176) [spring-ldap-core-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.security.ldap.SpringSecurityLd apTemplate.searchForSingleEntryInternal(SpringSecu rityLdapTemplate.java:208) [spring-security-ldap-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.ldap.authentication.a d.ActiveDirectoryLdapAuthenticationProvider.search ForUser(ActiveDirectoryLdapAuthenticationProvider. java:285) [spring-security-ldap-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.ldap.authentication.a d.ActiveDirectoryLdapAuthenticationProvider.doAuth entication(ActiveDirectoryLdapAuthenticationProvid er.java:130) [spring-security-ldap-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.ldap.authentication.A bstractLdapAuthenticationProvider.authenticate(Abs tractLdapAuthenticationProvider.java:61) [spring-security-ldap-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.authentication.Provid erManager.authenticate(ProviderManager.java:156) [spring-security-core-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.authentication.Provid erManager.authenticate(ProviderManager.java:177) [spring-security-core-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.authentication.Us ernamePasswordAuthenticationFilter.attemptAuthenti cation(UsernamePasswordAuthenticationFilter.java:9 4) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:211) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.context.request.a sync.WebAsyncManagerIntegrationFilter.doFilterInte rnal(WebAsyncManagerIntegrationFilter.java:50) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:108) [spring-web-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:87) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.FilterChainProxy. doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    at org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:344) [spring-web-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:261) [spring-web-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at io.undertow.servlet.core.ManagedFilter.doFilter(Ma nagedFilter.java:56) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterC hainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at com.adv.efin.ianalytics.webapp.filter.MDCFilter.do Filter(MDCFilter.java:77) [classes:]
    at io.undertow.servlet.core.ManagedFilter.doFilter(Ma nagedFilter.java:56) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterC hainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.FilterHandler.handleR equest(FilterHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.security.ServletSecur ityRoleHandler.handleRequest(ServletSecurityRoleHa ndler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.ServletDispatchingHan dler.handleRequest(ServletDispatchingHandler.java: 36) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at org.wildfly.extension.undertow.security.SecurityCo ntextAssociationHandler.handleRequest(SecurityCont extAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handl eRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.security.SSLInformati onAssociationHandler.handleRequest(SSLInformationA ssociationHandler.java:113) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.security.handlers.AuthenticationCallHa ndler.handleRequest(AuthenticationCallHandler.java :52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.security.handlers.AbstractConfidential ityHandler.handleRequest(AbstractConfidentialityHa ndler.java:45) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.security.ServletConfi dentialityConstraintHandler.handleRequest(ServletC onfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.security.CachedAuthen ticatedSessionHandler.handleRequest(CachedAuthenti catedSessionHandler.java:70) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.security.handlers.SecurityInitialHandl er.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.server.handlers.PredicateHandler.handl eRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at org.wildfly.extension.undertow.security.jacc.JACCC ontextIdHandler.handleRequest(JACCContextIdHandler .java:61)
    at io.undertow.server.handlers.PredicateHandler.handl eRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.server.handlers.PredicateHandler.handl eRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler .handleFirstRequest(ServletInitialHandler.java:240 ) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler .dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler .access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler $1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.server.Connectors.executeRootHandler(C onnectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.server.HttpServerExchange$1.run(HttpSe rverExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source) [rt.jar:1.7.0_11]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source) [rt.jar:1.7.0_11]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_11]

    -------------------------------------------------------------------------------

    here is the security-bean.xml file
    ----------------------------------------

    <http use-expressions="true">

    <intercept-url pattern="/login" access="permitAll"/>
    <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>

    <form-login/>

    </http>

    <authentication-manager>
    <authentication-provider ref="ldapActiveDirectoryAuthProvider"/>
    </authentication-manager>

    <beans:bean id="ldapActiveDirectoryAuthProvider"
    class="org.springframework.security.ldap.authentic ation.ad.ActiveDirectoryLdapAuthenticationProvider ">
    <beans:constructor-arg value="example.com"/>
    <beans:constructor-arg value="ldap://192.XXX.XX.XXX:389/"/>
    <beans:property name="useAuthenticationRequestCredentials" value="true" />
    <beans:property name="convertSubErrorCodesToExceptions" value="true" />
    </beans:bean>

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    366
    Rep Power
    6

    Default Re: Error occured while configuring Active Director Ldap connection using Spring secu

    First make sure you use proper version of apache commons-lang


    org.apache.commons.lang
    Class StringUtils

    replaceEach
    Since:
    2.4


    You need to use commons-lang-2.4 or later

Similar Threads

  1. Replies: 2
    Last Post: 01-02-2014, 05:02 PM
  2. LDAP - Active Directory Login with JNDI
    By bvilten in forum New To Java
    Replies: 3
    Last Post: 05-10-2013, 10:58 PM
  3. Spring LDAP problem...
    By nareshthota in forum Spring
    Replies: 0
    Last Post: 03-28-2012, 12:56 PM
  4. Replies: 0
    Last Post: 11-19-2011, 07:25 PM
  5. Configuring LDAP and JAVA
    By peiceonly in forum Advanced Java
    Replies: 2
    Last Post: 04-19-2007, 07:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •