本文介绍了SLF4J:类路径包含多个SLF4J绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误.似乎有多个绑定到sl4j的日志记录框架.不确定如何解决此问题.任何帮助,我们将不胜感激.

I'm getting the following error. It seems there are multiple logging frameworks bound to sl4j. Not sure how to resolve this. Any help is greatly appreciated.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

推荐答案

通过在导致冲突的(pom.xml)依赖项中添加以下排除项来解决.

Resolved by adding the following exclusion in the dependencies (of pom.xml) that caused conflict.

<exclusions>
    <exclusion>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
    </exclusion>
</exclusions>

这篇关于SLF4J:类路径包含多个SLF4J绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 19:45