0

我正在使用这个文档

但是 pom.xml 发生了一些变化(因为示例中的依赖项没有解决,并且我有 maven 错误消息),所以 pom.xml 的一部分我接下来:

 <dependency>
        <groupId>org.apache.directory.server</groupId>
        <artifactId>apacheds-core</artifactId>
        <version>2.0.0-M15</version>
    </dependency>

    <dependency>
        <groupId>org.apache.directory.server</groupId>
        <artifactId>apacheds-all</artifactId>
        <version>1.5.7</version>
    </dependency>

    <dependency>
        <groupId>org.apache.directory.server</groupId>
        <artifactId>apacheds-server-integ</artifactId>
        <version>1.5.7</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>

    <dependency>
            <groupId>org.apache.directory.client.ldap</groupId>
        <artifactId>ldap-client-api</artifactId>
        <version>0.1</version>
    </dependency>

然后我从示例运行测试我收到这样的错误:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Class org.apache.directory.server.core.DefaultDirectoryService does not implement the requested interface org.apache.directory.server.core.DirectoryService
at org.apache.directory.server.core.integ.FrameworkRunner.run(FrameworkRunner.java:170)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)

有任何想法吗?

测试类: http: //pastebin.com/aPisMRSx

4

1 回答 1

1

将 apacheds-all 的版本更改为与 apacheds-core 相同的版本

于 2013-11-08T13:09:20.113 回答