我的依赖树和多个 SLF4J 绑定有问题.到目前为止,我发现通常这只会导致警告,但在我的情况下,它似乎会阻止我的程序运行:这些是我得到的例外:
I have a problem with my dependency tree and multiple SLF4J binding. What I found out so far is that usually this only causes a warning but in my case it seems to prevent my program from running: These are the exceptions I get:
SLF4J:类路径包含多个 SLF4J 绑定.SLF4J:在 [jar:file:/C:/Users/FischerNi/.m2/repository/org/slf4j/slf4j-jdk14/1.5.3/slf4j-jdk14-1.5.3.jar!/org/slf4j/中找到绑定impl/StaticLoggerBinder.class]SLF4J:在 [jar:file:/C:/Users/FischerNi/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/中找到绑定impl/StaticLoggerBinder.class]SLF4J:请参阅 http://www.slf4j.org/codes.html#multiple_bindings 了解一个解释.SLF4J:slf4j-api 1.6.x(或更高版本)与此绑定不兼容.SLF4J:您的绑定是 1.5.5 或更早版本.SLF4J:将您的绑定升级到版本 1.6.x.或 2.0.x线程主"java.lang.NoSuchMethodError 中的异常:org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/FischerNi/.m2/repository/org/slf4j/slf4j-jdk14/1.5.3/slf4j-jdk14-1.5.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/FischerNi/.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. SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding. SLF4J: Your binding is version 1.5.5 or earlier. SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
这是我依赖项的相关部分:网络.lightbody.bmpbrowsermob 代理2.0-beta-8
and this is the relevant piece of my dependencies: net.lightbody.bmp browsermob-proxy 2.0-beta-8
<!-- LOGGING DEPENDENCIES - LOG4J -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
谁能告诉我如何解决这个问题?
Can somebody please tell me how to resolve this issue?
有几个解决方案:
这篇关于多个 SLF4J 绑定会导致错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!