SLF4J关于多个绑定的警告

时间:2015-08-06 09:55:11

标签: java eclipse binding slf4j

我尝试学习RCP并希望this但是当我点击运行然后我得到了多个绑定

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://940.fwk970900790:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://940.fwk970900790:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

我该如何解决?

谢谢, patrio

1 个答案:

答案 0 :(得分:2)

您的环境中可能存在多个问题

  1. 您确定类路径中只有 slf4j.jar 吗?
  2. 如果您在项目中使用 Maven 其他jar文件,包括 slf4j.jar ,则可能会这样。
  3. 确保最新的 slf4j.jar 应该是eclipse类路径中的第一个。
  4. 对于Maven用户执行此操作

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