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-11-05 18:34:30

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

Silverlight MultiBindings, How to attached multiple bindings to a single property.

原文http://www.scottlogic.co.uk/blog/colin/2009/06/silverlight-multibindings-how-to-attached-mutiple-bindings-to-a-single-property/   June 25th, 2009 by Colin Eberhardt This blog posts describes a technique for associating multiple bindings with a sing

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. How

slf4j与jul、log4j1、log4j2、logback的集成原理

1 系列目录 jdk-logging.log4j.logback日志介绍及原理 commons-logging与jdk-logging.log4j1.log4j2.logback的集成原理 slf4j与jdk-logging.log4j1.log4j2.logback的集成原理 slf4j.jcl.jul.log4j1.log4j2.logback大总结 2 slf4j 先从一个简单的使用案例来说明 2.1 简单的使用案例 private static Logger logger=LoggerF

Spring Data 官方文档》4.7 Spring Data扩展

4.7 Spring Data扩展 这部分说明Spring Data一系列的扩展功能,可以使Spring Dta使用多样的上下文.目前大部分集成是针对Spring MVC. 4.7.1 Querydsl扩展 Querydsl是一个框架,通过它的流式API构建静态类型的SQL类查询.多个Spring Data模块通过QueryDslPredicateExecutor与Querydsl集成. 例29 QueryDslPredicateExecutor接口 1 public interface Que

轻松搞定RabbitMQ(五)——路由选择

       翻译地址:http://www.rabbitmq.com/tutorials/tutorial-four-java.html        在前篇博文中,我们建立了一个简单的日志系统.可以广播消息给多个消费者.本篇博文,我们将添加新的特性--我们可以只订阅部分消息.比如:我们可以接收Error级别的消息写入文件.同时仍然可以在控制台打印所有日志. Bindings(绑定)        在上一篇博客中我们已经使用过绑定.类似下面的代码: channel.queueBind(queu

Zend Framework实现Zend_View集成Smarty模板系统的方法_php实例

本文实例讲述了Zend Framework实现Zend_View集成Smarty模板系统的方法.分享给大家供大家参考,具体如下: Zend_View抽象出了Zend_View_Interface,可以让我们集成不同的视图解决方案,例如可以集成smarty.要在zend中使用其他视图系统作为视图,只要实现Zend_View_Interface接口即可. Zend_View_Interface的接口定义: <?php /** * Interface class for Zend_View compa

RabbitMQ(四) -- Routing

`rabbitmq`可以通过路由选择订阅者来发布消息. Bindings 通过下面的函数绑定Exchange与消息队列: channel.queue_bind(exchange=exchange_name, queue=queue_name) 可以通过添加`routing_key`来做路由选择,如下: channel.queue_bind(exchange=exchange_name, queue=queue_name, routing_key='black') Direct Exchange

RabbitMQ消息队列(五):Routing 消息路由

    上篇文章中,我们构建了一个简单的日志系统.接下来,我们将丰富它:能够使用不同的severity来监听不同等级的log.比如我们希望只有error的log才保存到磁盘上. 1. Bindings绑定     上篇文章中我们是这么做的绑定: channel.queue_bind(exchange=exchange_name, queue=queue_name)     绑定其实就是关联了exchange和queue.或者这么说:queue对exchagne的内容感兴趣,exchange要把它

生产环境oracle10g升级至11g准备工作

最近需要生产系统从10.2.0.5.升级到11.2.0.2.0 做了不少的准备工作,硬是在周末自己搭了测试环境,照着自己准备的升级步骤练习了一番. 除过基本的检查,从Metalink上下载了最新的psu,和公司的资深dba确认后,提供了给了客户.这样数据库就算是升级到11.2.0.2.10 主要有以下的步骤 : 1.new ORACLE_HOME(11g), old ORACLE_HOME (10g) --这些需要提前提供给客户,作为基本的约定 2.install oracle software