当前位置: 首页 > 知识库问答 >
问题:

SLF4J:类路径包含多个SLF4J绑定

凌蕴藉
2023-03-14

我得到以下错误。似乎有多个日志记录框架绑定到SLF4J。不知道该怎么解决。非常感谢任何帮助。

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.

共有2个答案

邹开畅
2023-03-14

分级版本;

configurations.all {
    exclude module: 'slf4j-log4j12'
}
汤玉宸
2023-03-14

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

<exclusions>
    <exclusion>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
    </exclusion>
</exclusions> 
 类似资料:
  • 我在运行java代码时遇到以下运行时异常。有人能帮我解决绑定冲突吗。

  • 我在netbeans中有一个纯Java项目,我得到的警告是: 当然,我搜索了警告,但所有的答案都与用maven或pom.xml文件删除重复绑定有关。但是我没有pom.xml文件,也没有使用Maven。 那么如何排除绑定呢?

  • 我在其他问题中看到,通常此警告的解决方案是从导致此冲突的依赖项中排除slf4j,但我无法在我的项目中发现问题。 我运行命令,输出如下:

  • 在将apache.mahout添加到pom.xml之后,我在运行spring项目时开始出现这个警告,我想知道如何抑制这个警告。 这是我的pom.xml 我试图排除slf4j-log4j12,但仍然不能工作,每次都有警告 我找遍了所有的地方,但我无法移除警告。 有什么建议吗?

  • 我的应用程序服务器ibm WebSphere。我在应用程序服务器日志中得到以下错误。哪里可以设置websphere? [19.09.2012 14:56:54:940 EEST]0000000a SystemErr R SLF4J:类路径包含多个SLF4J绑定。 [19.09.2012 14:56:54:940 EEST]0000000a SystemErr R SLF4J:在[wsjar:fil