当我运行我的程序时,我在我的控制台中得到以下信息:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/.m2/repository/ch/qos/logback/logback-classic/1.1.1/logback-classic-1.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/.m2/repository/org/apache/activemq/activemq-all/5.9.0/activemq-all-5.9.0.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]
如问题 here 中所述“我们无法使用 maven 依赖项排除命令来不采用 activemq-all 贡献的 slf4j-log4j12 Artifact 。” 我不确定我现在是否遵循它的工作。这是否意味着我必须使用 5.10-SNAPSHOT?我打算像这个 question 中的答案一样接受 activemq-core ,但我需要在 5.9.0 中发布的东西,而核心只能升级到 5.9。我希望有人可以给我建议。我真的需要帮助。
最佳答案
通常,如果 activemq-all 不符合您的需求,请从 activemq-client jar 开始。
旧的 activemq-broker jar 在某些版本之前被切割成几 block 。
您可能还希望包含 JMS 规范:
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.1.1</version>
</dependency>
关于java - activemq 依赖项不适用于 logback,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22277057/