使用ldap服务器的Spring安全性自定义登录

时间:2014-03-17 08:38:55

标签: eclipse spring spring-security ldap

我正在尝试使用spring security和ldap进行自定义登录验证。但是我的配置文件中出现以下错误。我不知道究竟是什么问题。请帮助我

**springsecurity.xml**
<security:http auto-config="true">
<security:intercept-url pattern="/main*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:form-login login-page="/login" default-target-url="/main"
authentication-failure-url="/loginError"/>
</security:http>
<security:authentication-manager>
<security:authentication-provider ref="ldapActiveDirectoryAuthProvider" />          
</security:authentication-manager>
<beans:bean id="ldapActiveDirectoryAuthProvider"           class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
<beans:constructor-arg value="xyz.com" />
<beans:constructor-arg value="ldap://xyz.com/"/> 
  

错误:org.springframework.web.context.ContextLoader - 上下文   初始化失败   org.springframework.beans.factory.BeanCreationException:错误   用名字创建bean   'org.springframework.security.authentication.ProviderManager#0':   无法创建类型的内部bean'(内部bean)'   [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean]   设置bean属性'parent';嵌套异常是   org.springframework.beans.factory.BeanCreationException:错误   创建名为'(inner bean)'的bean:FactoryBean引发了异常   对象创建;嵌套异常是   org.springframework.beans.factory.BeanCreationException:错误   用名字创建bean   'org.springframework.security.authenticationManager':无法解决   设置bean时引用bean'ldapActiveDirectoryAuthProvider'   带密钥[0]的财产'提供者';嵌套异常是   org.springframework.beans.factory.BeanCreationException:错误   创建名为'ldapActiveDirectoryAuthProvider'的bean   ServletContext资源[/WEB-INF/spring/root-context.xml]:解析   bean类的声明构造函数   [org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider]   来自ClassLoader [WebappClassLoader上下文:/ pack delegate:false   库:       / WEB-INF /类/   ----------&GT;父类加载器:org.apache.catalina.loader.StandardClassLoader@19189e1]失败;   嵌套异常是java.lang.NoClassDefFoundError:   组织/ springframework的/安全/核心/权威/制图/ GrantedAuthoritiesMapper     在   org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)     在   org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)     在   org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:294)     在   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)     在   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)     在   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)     在   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)     在   org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)     在   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)     在   org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)     在   org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)     在   org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)     在   org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1559)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)     at java.util.concurrent.FutureTask $ Sync.innerRun(FutureTask.java:303)     在java.util.concurrent.FutureTask.run(FutureTask.java:138)at   java.util.concurrent.ThreadPoolExecutor中的$ Worker.runTask(ThreadPoolExecutor.java:885)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:907)     在java.lang.Thread.run(Thread.java:619)

0 个答案:

没有答案