ActiveMQ错误 jar包冲突(slf4j-log4j12.jar slf4j-api.jar log4j.jar )
来源:互联网 发布:软件项目管理工具 编辑:程序博客网 时间:2024/05/19 23:26
1.如果运行程序出现错误:“Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory”,这是因为项目缺少slf4j-api.jar和slf4j-log4j12.jar这两个jar包导致的错误。
2.如果运行程序出现错误:“java.lang.NoClassDefFoundError: org/apache/log4j/LogManager”,这是因为项目缺少log4j.jar这个jar包
3.错误:“Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.MDC.getCopyOfContextMap()Ljava/util/Map”,这是因为jar包版本冲突造成的。
slf4j-log4j12.jar版本信息:
Manifest-Version: 1.0Archiver-Version: Plexus ArchiverCreated-By: Apache MavenBuilt-By: cekiBuild-Jdk: 1.5.0_06Bundle-Description: The slf4j log4j-12 bindingBundle-Version: 1.3.1Implementation-Version: 1.4.2Implementation-Title: slf4j-log4j12Bundle-ManifestVersion: 2Bundle-SymbolicName: slf4j.log4j12Bundle-Name: slf4j-log4j12Bundle-Vendor: SLF4J.ORGExport-Package: org.slf4j.impl;version=1.3.1Import-Package: org.slf4j;version="[1.3,1.4)", org.slf4j.spi;version=" [1.3,1.4)", org.slf4j.helpers;version="[1.3,1.4)", org.apache.log4j
slf4j-api.jar版本信息:
Manifest-Version: 1.0Archiver-Version: Plexus ArchiverCreated-By: Apache MavenBuilt-By: cekiBuild-Jdk: 1.5.0_06Bundle-Description: The slf4j APIBundle-Version: 1.3.1Implementation-Version: 1.4.2Implementation-Title: slf4j-apiBundle-ManifestVersion: 2Bundle-SymbolicName: slf4j.apiBundle-Name: slf4j-apiBundle-Vendor: SLF4J.ORGExport-Package: org.slf4j;version=1.3.1, org.slf4j.spi;version=1.3.1, org.slf4j.helpers;version=1.3.1Import-Package: org.slf4j.impl;version="[1.3,1.4)"
log4j.jar版本信息:
Manifest-Version: 1.0Ant-Version: Apache Ant 1.6.5Created-By: 1.3.1_18-b01 (Sun Microsystems Inc.)Name: org/apache/log4j/Implementation-Title: log4jImplementation-Version: 1.2.14Implementation-Vendor: "Apache Software Foundation"
后来将log4j.jar版本从上面的1.2.14换到1.2.11
Manifest-Version: 1.0Ant-Version: Apache Ant 1.6.4Created-By: 1.4.2_06-b03 (Sun Microsystems Inc.)Name: org/apache/log4j/Implementation-Title: log4jImplementation-Version: 1.2.11Implementation-Vendor: "Apache Software Foundation"
就不再出现“Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.MDC.getCopyOfContextMap()Ljava/util/Map”错误了。
4.ActiveMQ错误:Wire format negociation timeout: peer did not send his wire format.
官方解释:http://activemq.apache.org/javaxjmsjmsexception-wire-format-negociation-timeout-peer-did-not-send-his-wire-format.html
我出现这样的错误主要是因为ActiveMQ与slf4j的版本有冲突,我原先使用的是以前一种用的slf4j-1.4。后来看apache-activemq-5.5.1\lib目录下有slf4j-api-1.5.11.jar、slf4j-log4j12-1.5.11.jar和log4j-1.2.14.jar。我想这几个jar应该是和ActiveMQ匹配的,就使用了这三个jar,最终错误解决。
- ActiveMQ错误 jar包冲突(slf4j-log4j12.jar slf4j-api.jar log4j.jar )
- 日志系统jar包:slf4j-api, slf4j-log4j12以及log4j
- 日志系统jar包:slf4j-api, slf4j-log4j12以及log4j
- log4j-over-slf4j.jar 与slf4j-log4j12.jar 依赖冲突
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar
- storm出现log4j-over-slf4j.jar和slf4j-log4j12.jar冲突
- log4j-over-slf4j.jar AND slf4j-log4j12.jar 依赖冲突解决方案
- hbase数据库---slf4j-log4j12-1.6.4.jar包冲突
- slf4j jar包冲突解决方案
- curator-x-rpc-2.9.1.jar和slf4j-api-1.5.2、slf4j-log4j12-1.5.2冲突
- 13.4 库依赖冲突问题:Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
- activemq-all.jar包引入导致slf4j冲突的解决办法
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflow
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflow
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflow
- Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
- java类集---Iterator接口
- jpuery操作图片的淡入淡出效果
- JAVA学习笔记+变量的种类
- 制作Ramdisk文件系统
- SSH整合之入门级例子:简易留言板(完整源码)
- ActiveMQ错误 jar包冲突(slf4j-log4j12.jar slf4j-api.jar log4j.jar )
- 不想写博客的题目
- 面向对象--不能对非静态字段进行静态引用 面向对象-static 类名.对象
- 欧氏距离与余弦距离
- java知识总结,不定时更新
- Quartz 在spring中动态设置cronExpression
- web通信之长连接,长轮询(long polling)
- SQL简明数据分析教程
- 洛谷1081/codevs1199 开车旅行 链表,倍增,模拟