【发布时间】:2021-05-06 19:14:03
【问题描述】:
我在 SLES 15 机器上使用 2019-09 的 Eclipse CDT 发行版(v4.13,内部版本号:I20190916-1045)(不要问...)
当我启动 Eclipse 时,我在控制台上看到以下文本:
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /home/lh156516/workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://470.fwk441444733:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://470.fwk441444733: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]
我的问题:
- 为什么“在初始化状态位置之前激活了 logback 配置包”?
- 我怎样才能让“捆绑包”只在它应该被激活时才被激活?
- 为什么 Simple Logging Facade for Java 的 Class 路径包含多个 SLF4J 绑定?
- 我可以并且应该更改类路径以使其仅包含一个“SLF4J 绑定”吗?
注意:我不是一个“Java 人”,也不熟悉 Eclipse 平台的内部工作原理;把我想象成一个外行的 Eclipse 用户。
【问题讨论】:
-
这看起来像是您在复古 Eclipse 中拥有的插件/捆绑包之间的不兼容(m2e 是默认情况下不包含在 C/C++ Eclipse IDE 中的 Maven 支持)。但是这些是关于日志初始化的警告,而不是错误,您可以忽略。 Eclipse 是一个 OSGi 应用程序,因此没有像普通 Java 应用程序那样可以更改的平面类路径。捆绑包通常在需要时被激活(惰性),但 SLF4J 在创建时并未考虑到可以在运行时启动和停止的捆绑包。无论如何,不要在落后 5 个版本的旧 Eclipse 上浪费时间。
-
@howlger:所以,你是在建议我更新到新版本并在那里尝试?
-
我说这只是可以忽略的噪音(见here和here)。除此之外,请确保您没有使用不再维护的软件 (Eclipse does not have an LTS version)。
-
@howlger:我意识到这个可以被忽略。但我想让它消失,而不是乱扔我的控制台。
-
你能用 Eclipse IDE for C/C++ Developers 2020-12 重现这个吗?我不能。
标签: java eclipse eclipse-cdt slf4j