我在Spring Boot Application中实现了LDAP身份验证。添加的依赖项如下:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-all</artifactId>
</dependency>
但是我仍然关注ClassNotFoundException:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain'
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]
Caused by: java.lang.NoClassDefFoundError: org/apache/directory/server/core/DirectoryService
Caused by: java.lang.ClassNotFoundException: org.apache.directory.server.core.DirectoryService
我的maven依赖树清楚地显示了apacheds-all已成功添加。
为什么我仍然会收到此错误?
答案 0 :(得分:7)
Spring Security不支持Apache DS 2.0。相反,您需要使用1.5.5。另请注意,由于API更改中断,不支持以后的1.5.x版本。