ClassNotFoundException:带有apacheds的DirectoryService - 全部已包含在内

ddd*_*ddd 0 spring ldap spring-security spring-boot

我在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>
Run Code Online (Sandbox Code Playgroud)

但是我仍然得到以下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
Run Code Online (Sandbox Code Playgroud)

我的maven依赖树清楚地显示了apacheds-all成功添加. 在此输入图像描述

为什么我仍然会收到此错误?

And*_*son 7

Spring Security不支持Apache DS 2.0.相反,您需要使用1.5.5.另请注意,由于API更改中断,不支持以后的1.5.x版本.