Eclipse RCP插件中的多个slf4j绑定 [英] multiple slf4j bindings in Eclipse RCP Plugin

查看:380
本文介绍了Eclipse RCP插件中的多个slf4j绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Eclipse插件,它在激活时出现以下错误:

I have a simple Eclipse Plugin which gives me following error on activation:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://103.fwk8918249:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://103.fwk8918249:4/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

这两个网址都解析为捆绑中完全相同的jar

both URLs resolve to the exact same jar in the bundle

libs/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class




  • 我该如何解决这个问题?

  • 为什么捆绑包加载罐子两次(:1)和:4)?

  • 推荐答案

    这是定义SLF4J绑定的结果您的项目的类路径(JDT .classpath文件)和MANIFEST.MF文件。

    This is a result of defining an SLF4J binding in both your project's classpath (JDT .classpath file) and your MANIFEST.MF file.

    您应该从项目的类路径中删除SLF4J绑定:

    You should remove your SLF4J binding from your project's class path:


    YourProject→属性→ Java Build Path→库

    YourProject → Properties → Java Build Path → Libraries


    • 选择SLF4J绑定JAR并点击删除。

    一旦你这样做,你的类加载器中只应该有一个对SLF4J绑定的引用(因此不应出现错误信息)。

    Once you do this, there should only be a single reference to your SLF4J binding in your class loader (and thus the error message should not appear).

    这篇关于Eclipse RCP插件中的多个slf4j绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆