移动到 Neo4j 3.1.0 和 IllegalArgumentException:LoggerFactory 不是 Logback LoggerContext 但 Logback 在类路径上

Moving to Neo4j 3.1.0 and IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

我正在尝试将我的项目移动到 Neo4j 3.1.0,但现在我的 Maven Spring 启动应用程序失败,出现以下异常:

Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Neo4jLoggerFactory loaded from file:/.../.m2/repository/org/neo4j/neo4j-security-enterprise/3.1.0/neo4j-security-enterprise-3.1.0.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Neo4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext

能否请您指教,在这种情况下,我的应用程序中应该使用什么样的记录器实现以及如何修复它?

以下排除解决了问题:

<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-enterprise</artifactId>
    <version>${neo4j.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.neo4j</groupId>
            <artifactId>neo4j-security-enterprise</artifactId>
        </exclusion>
    </exclusions>
</dependency>