【问题标题】:Multiple SLF4J binding多个 SLF4J 绑定
【发布时间】:2018-07-10 06:04:09
【问题描述】:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/username/.m2/repository/ch/qos/logback/logback-classic/1.1.9/logback-classic-1.1.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/username/.m2/repository/org/slf4j/slf4j-simple/1.7.22/slf4j-simple-1.7.22.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/username/.m2/repository/org/slf4j/slf4j-log4j12/1.7.8/slf4j-log4j12-1.7.8.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 [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

我该如何解决这个问题。 谢谢

【问题讨论】:

  • 您好,欢迎来到 StackOverflow。请参阅stackoverflow.com/help/how-to-ask,了解如何提出正确的问题并根据指南改进您的问题。作为第一步,你应该提供一些关于你的系统的信息,更重要的是:你想做什么?就目前而言,您刚刚发布了一个日志文件。完全不清楚的问题。
  • 你有没有在“SLF4J: See slf4j.org/codes.html#multiple_bindings for an explanation.”中的链接?

标签: java maven slf4j


【解决方案1】:

Slf4j 是一个可以有多个实现的接口。您的依赖项中有三个实现:slf4j-log4j、slf4j-simple 和 logback-classic。决定一个并排除其他依赖项。

【讨论】:

    【解决方案2】:

    您可以查看slf4j站点的解决方案,搜索文本

    “在类路径上发现了多个绑定”

    here

    上面给出的示例可能不是一个精确的解决方案,您需要找到所有 3rd 方库使用 slf4j 版本并排除它们,同时将它们添加为依赖项。

    【讨论】:

      猜你喜欢
      • 2012-09-28
      • 2016-01-09
      • 2015-04-24
      • 1970-01-01
      • 2012-12-11
      • 2016-03-12
      • 2014-05-18
      • 2017-06-08
      • 2015-06-21
      相关资源
      最近更新 更多