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

时间:2017-01-03 11:39:14

标签: maven spring-boot neo4j logback slf4j

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

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

请问您能否告诉我在我的应用程序中应该使用哪种记录器实现以及如何解决它?

1 个答案:

答案 0 :(得分:1)

以下排除解决了这个问题:

<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>