Multiple bindings were found on the class path(转)

Multiple bindings were found on the class path

SLF4J API is designed to bind with one and only one underlying logging framework at a time. If more than one binding is present on the class path, SLF4J will emit a warning, listing the location of those bindings.

When multiple bindings are available on the class path, select one and only one binding you wish to use, and remove the other bindings. For example, if you have both slf4j-simple-1.7.9.jar and slf4j-nop-1.7.9.jar on the class path and you wish to use the nop (no-operation) binding, then remove slf4j-simple-1.7.9.jar from the class path.

The list of locations that SLF4J provides in this warning usually provides sufficient information to identify the dependency transitively pulling in an unwanted SLF4J binding into your project. In your project‘s pom.xml file, exclude this SLF4J binding when declaring the unscrupulous dependency. For example, cassandra-all version 0.8.1 declares both log4j and slf4j-log4j12 as compile-time dependencies. Thus, when you include cassandra-all as a dependency in your project, the cassandra-all declaration will cause both slf4j-log4j12.jar and log4j.jar to be pulled in as dependencies. In case you do not wish to use log4j as the the SLF4J backend, you can instruct Maven to exclude these two artifacts as shown next:

<dependencies>
  <dependency>
    <groupId> org.apache.cassandra</groupId>
    <artifactId>cassandra-all</artifactId>
    <version>0.8.1</version>

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

  </dependency>
</dependencies>

http://www.slf4j.org/codes.html#multiple_bindings
时间: 2024-08-03 19:20:53

Multiple bindings were found on the class path(转)的相关文章

SLF4J warning or error messages and their meanings

来自:http://www.slf4j.org/codes.html#StaticLoggerBinder The method o.a.commons.logging.impl.SLF4FLogFactory#release was invoked. Given the structure of the commons-logging API, in particular as implemented by SLF4J, the o.a.commons.logging.impl.SLF4FLo

SLF4J warning or error messages and their meanings(转)

The method o.a.commons.logging.impl.SLF4FLogFactory#release was invoked. Given the structure of the commons-logging API, in particular as implemented by SLF4J, the o.a.commons.logging.impl.SLF4FLogFactory#release()method should never be called. Howev

记一次项目上线后Log4j2不输出日志的坑

公司项目采用了Log4j2来输出日志,在开发环境和测试环境下均可以输出日志,但在生成环境就没有日志输出.开始毫无头绪,后来通过不断的排查,终于解决了这个问题.在此记录下该问题的解决过程,便于后续查阅. 一.发现问题 p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; line-height: 125%; font-family: "Times New Roman"; font-size: 12.

spark 与 Hadoop 融合后启动 slf4j提示Class path contains multiple SLF4J bindings

相关参考文献: https://www.oschina.net/question/93435_174549 警告信息如下: 看起来明明就是一个文件,怎么还提示multiple bindings呢,slf4j这货一直没用明白,求解 其它参考文献: http://www.slf4j.org/news.html August 19th, 2011 - Release of SLF4J 1.6.2 本文解决方法: find ./ -name "slf4j*" 分别找出 hadoop 和 spa

Knockout源代码精析-怎样解析demo元素,获取到bindings(二)?

接上文这里開始分析applyBindingsToNodeInternal.applyBindingsToNodeInternal方法例如以下: function applyBindingsToNodeInternal(node, sourceBindings, bindingContext, bindingContextMayDifferFromDomParentElement) { // Prevent multiple applyBindings calls for the same nod

Knockout源码精析-如何解析demo元素,获取到bindings?

接上文这里开始分析applyBindingsToNodeInternal.applyBindingsToNodeInternal方法如下: function applyBindingsToNodeInternal(node, sourceBindings, bindingContext, bindingContextMayDifferFromDomParentElement) { // Prevent multiple applyBindings calls for the same node,

异步IO\数据库\队列\缓存

本节内容 Gevent协程 Select\Poll\Epoll异步IO与事件驱动 Python连接Mysql数据库操作 RabbitMQ队列 Redis\Memcached缓存 Paramiko SSH Twsited网络框架 引子 到目前为止,我们已经学了网络并发编程的2个套路, 多进程,多线程,这哥俩的优势和劣势都非常的明显,我们一起来回顾下 协程 协程,又称微线程,纤程.英文名Coroutine.一句话说明什么是线程:协程是一种用户态的轻量级线程. 协程拥有自己的寄存器上下文和栈.协程调度

缓存,队列(Redis,RabbitMQ)

一.Redis 更新中..... 二.RabbitMQ 1.简介 RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.他遵循Mozilla Public License开源协议. MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法.应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们.消息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通信,直接调用通常是用于诸如远程过程调用的技术.排

Device Mapper Multipath(DM-Multipath)

Device Mapper Multipath(DM-Multipath)可以将服务器节点和存储阵列之间的多条I/O链路配置为一个单独的设备.这些I/O链路是由不同的线缆.交换机.控制器组成的SAN物理链路.Multipath将这些链路聚合在一起,生成一个单独的新的设备. 1.DM-Multipath概览: (1)数据冗余 DM-Multipath可以实现在active/passive模式下的灾难转移.在active/passive模式下,只有一半的链路在工作,如果链路上的某一部分(线缆.交换机