我使用弹簧 LDAP。
弹簧servlet.xml:
<authentication-manager alias="authenticationManager" xmlns="http://www.springframework.org/schema/security">
<ldap-authentication-provider
user-search-filter="(uid={0})"
group-search-filter="member={0}"/>
</authentication-manager>
<sec:ldap-server url="ldap://__server__.com:389" />
pom.xml:提供了 org.springframework.ldap spring-ldap 1.3.0.RELEASE pom
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core-tiger</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>
运行时出现异常 ( mvn tomcat:run
):
sparklr2 19:04:24.925 [ERROR] DispatcherServlet - Context initialization failed <org.springframework.context.ApplicationContextException: Couldn't locate: org.s pringframework.ldap.core.support.BaseLdapPathContextSource. If you are using LD AP with Spring Security, please ensure that you include the spring-ldap jar file in your application; nested exception is java.lang.ClassNotFoundException: org. springframework.ldap.core.support.BaseLdapPathContextSource>org.springframework. context.ApplicationContextException: Couldn't locate: org.springframework.ldap.c ore.support.BaseLdapPathContextSource. If you are using LDAP with Spring Securi ty, please ensure that you include the spring-ldap jar file in your application; nested exception is java.lang.ClassNotFoundException: org.springframework.ldap. core.support.BaseLdapPathContextSource
我可以在.m2
文件夹中看到
m2\repository\org\springframework\ldap\spring-ldap-core\1.3.0.RELEASE\spring-ldap-core-1.3.0.RELEASE.jar
其中有
spring-ldap-core-1.3.0.RELEASE.jar\org\springframework\ldap\core\support\BaseLdapPathContextSource.class
什么不见了?如何解决异常?