首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SLF4J SLF4J:类路径包含多个Maven绑定

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

Stack Overflow用户
提问于 2014-04-06 23:47:09
回答 4查看 77.5K关注 0票数 27

在运行我的java代码时,我得到了以下运行时异常。有没有人能帮我解决绑定冲突。

代码语言:javascript
复制
    SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Air/Desktop/sms/slf4j-1.7.7/slf4j-android-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Air/Desktop/sms/slf4j-1.7.7/slf4j-jcl-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Air/Desktop/sms/slf4j-1.7.7/slf4j-jdk14-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Air/Desktop/sms/slf4j-1.7.7/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Air/Desktop/sms/slf4j-1.7.7/slf4j-nop-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Air/Desktop/sms/slf4j-1.7.7/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.AndroidLoggerFactory]
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Fatal error in constructor!
    ... 2 more
EN

回答 4

Stack Overflow用户

发布于 2014-04-06 23:50:00

您似乎有几个SLF4J实现;您应该排除所有不必要的实现

票数 6
EN

Stack Overflow用户

发布于 2014-10-10 00:21:55

这个错误意味着您的类路径中有多个SLF4J实现。查看这些错误具体说明了什么。即:SLf4J: Found binding in..... (这将打印它找到StaticLoggerBinder.class实例的所有jar文件)。从类路径中删除所有此类jar,但需要其StaticLoggerBinder.class实现的jar除外。

票数 5
EN

Stack Overflow用户

发布于 2016-04-13 14:35:08

您可以转到POM.xml,打开依赖关系层次结构,然后通过右键单击"exclude maven entries.Except“找到slf4j maven one exclude one

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22896243

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档