简体   繁体   中英

Issues with ActiveMQ client: ClassNotFoundException org.apache.logging.log4j.spi.AbstractLoggerAdapter

I have a small ActiveMQ client that is supposed to just connect to the AMQ service, create a queue, and send out a message. I am getting the following error message:

Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter
  at java.lang.ClassLoader.defineClassl(Native Method)
  ...

The following jars are on my 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

If I take away the top three libraries I get the error Failed to load class “org.slf4j.impl.StaticLoggerBinder”

I've tried searching but I can't say that I've found anything that has worked so far.

您需要将 log4j-api-2.6.2.jar 添加到您的类路径中。

I had exactly the same error. I replaced org.apache.logging.log4j:log4j-slf4j-impl:2.12.1 to org.slf4j:slf4j-simple:2.0.0-alpha1 . It helped me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM