【发布时间】:2012-12-11 01:51:03
【问题描述】:
我收到以下错误。似乎有多个日志框架绑定到 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.
【问题讨论】:
-
已解决在导致冲突的依赖项(pom.xml)中使用
<exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> </exclusions>有助于解决问题 -
您是否已经按照警告中的说明检查了slf4j.org/codes.html#multiple_bindings?
-
也许最好为这个问题添加一个答案(自动回答)并将其标记为“已接受”,因此该问题将在 SO 搜索中显示为“已解决”
-
罗伯托,感谢您的反馈。我从评论中复制了解决方案并将其发布为答案。