简体   繁体   English

SLF4J链接错误

[英]SLF4J Linkage Error

I have configured JMS Provide in WebSphere Application Server that will use ActiveMQ. 我已经在将使用ActiveMQ的WebSphere Application Server中配置了JMS Provide。 For sending message WebSphere needs " activemq-all-5.9.1.jar " in classpath so I added it. 为了发送消息,WebSphere在类路径activemq-all-5.9.1.jar需要“ activemq-all-5.9.1.jar ”,因此我添加了它。 This " activemq-all " contains slf4j classes in it. 此“ activemq-all ”中包含slf4j classes

Now my application contains " slf4j-api-1.7.5.jar ". 现在,我的应用程序包含“ slf4j-api-1.7.5.jar ”。 When I start WebSphere it gives 当我启动WebSphere时,它给出了

Caused by: java.lang.LinkageError: org.slf4j.LoggerFactory
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:264)

I tried using different activemq jars that does not contain slf4j classes but at that time it gives ClassNotFoundExeption 我尝试使用不包含slf4j类的不同activemq jar,但当时它提供了ClassNotFoundExeption

This is because slf4j logger cannot be binded twice. 这是因为slf4j记录器无法绑定两次。 In current scenario both server and application are binding slf4j logger. 在当前情况下,服务器和应用程序都绑定slf4j记录器。

Use old ActiveMQ jars that does not depend on slf4j logger. 使用不依赖slf4j记录器的旧ActiveMQ jar。 In this way applications default logger will work. 这样,应用程序默认记录器将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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