ActiveMQ 客户端问题:ClassNotFoundException org.apache.logging.log4j.spi.AbstractLoggerAdapter
Issues with ActiveMQ client: ClassNotFoundException org.apache.logging.log4j.spi.AbstractLoggerAdapter
我有一个小型 ActiveMQ 客户端,它应该只是连接到 AMQ 服务、创建队列并发送消息。我收到以下错误消息:
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter
at java.lang.ClassLoader.defineClassl(Native Method)
...
以下罐子在我的 classpath
上:
log4j-1.2-api-2.6.2.jar
log4j-core-2.6.2.jar
log4j-slf4j-impl-2.6.2.jar
activemq-broker-5.13.3.jar
activemq-client-5.13.3.jar
activemq-console-5.13.3.jar
activemq-jaas-5.13.3.jar
activemq-kahadb-store-5.13.3.jar
activemq-openwire-legacy-5.13.3.jar
activemq-protobuf-1.1.jar
activemq-spring-5.13.3.jar
activemq-web-5.13.3.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
hawtbuf-1.11.jar
jcl-over-slf4j-1.7.13.jar
slf4j-api-1.7.13.jar
如果我去掉前三个库,我会得到错误 Failed to load class “org.slf4j.impl.StaticLoggerBinder”
我试过搜索,但我不能说我找到了到目前为止有用的东西。
您需要将 log4j-api-2.6.2.jar 添加到类路径中。
我有完全相同的错误。我将 org.apache.logging.log4j:log4j-slf4j-impl:2.12.1
替换为 org.slf4j:slf4j-simple:2.0.0-alpha1
。它帮助了我。
我有一个小型 ActiveMQ 客户端,它应该只是连接到 AMQ 服务、创建队列并发送消息。我收到以下错误消息:
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter
at java.lang.ClassLoader.defineClassl(Native Method)
...
以下罐子在我的 classpath
上:
log4j-1.2-api-2.6.2.jar
log4j-core-2.6.2.jar
log4j-slf4j-impl-2.6.2.jar
activemq-broker-5.13.3.jar
activemq-client-5.13.3.jar
activemq-console-5.13.3.jar
activemq-jaas-5.13.3.jar
activemq-kahadb-store-5.13.3.jar
activemq-openwire-legacy-5.13.3.jar
activemq-protobuf-1.1.jar
activemq-spring-5.13.3.jar
activemq-web-5.13.3.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
hawtbuf-1.11.jar
jcl-over-slf4j-1.7.13.jar
slf4j-api-1.7.13.jar
如果我去掉前三个库,我会得到错误 Failed to load class “org.slf4j.impl.StaticLoggerBinder”
我试过搜索,但我不能说我找到了到目前为止有用的东西。
您需要将 log4j-api-2.6.2.jar 添加到类路径中。
我有完全相同的错误。我将 org.apache.logging.log4j:log4j-slf4j-impl:2.12.1
替换为 org.slf4j:slf4j-simple:2.0.0-alpha1
。它帮助了我。