Could not initialize class org.apache.log4j.Log4jLoggerFactory
来源:互联网 发布:阿里云监控系统 编辑:程序博客网 时间:2024/05/20 04:47
最近对接aliyum.mns 时提示: Could not initialize class org.apache.log4j.Log4jLoggerFactory
最后跟踪代码,发现:com.aliyun.mns.client.Utils 类无法加载,报错代码位置:
原因: 这是因为 本项目中引用 slf4j-log4j12 与 aliyun.mns 引用 log4j 冲突 (2个有循环依赖,不可在同包下共存,具体可以了解 slf4j,log4j)
最后跟踪代码,发现:com.aliyun.mns.client.Utils 类无法加载,报错代码位置:
com.aliyun.mns.client.Utils 类: public static Logger logger = Logger.getLogger(Utils.class);
原因: 这是因为 本项目中引用 slf4j-log4j12 与 aliyun.mns 引用 log4j 冲突 (2个有循环依赖,不可在同包下共存,具体可以了解 slf4j,log4j)
解决: 排除本项目中slf4j-log4j12 引用。
例如: 我的项目中net.sf.dozer 有slf4j-log4j12引用,排除掉->
<dependency> <groupId>net.sf.dozer</groupId> <artifactId>dozer</artifactId> <exclusions> <exclusion> <artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions></dependency>
阅读全文
0 0
- Could not initialize class org.apache.log4j.Log4jLoggerFactory
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory 标签: l
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory
- Could not initialize class org.apache.log4j.LogManager
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4
- Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFa
- Could not initialize class org.apache.struts2.json.JSONResult
- org.apache.cxf.binding.soap.SoapFault: Could not initialize class
- Could not initialize class org.apache.xpath.compiler.FunctionTable
- Could not initialize class org.slf4j.LoggerFactory
- org.apache.cxf.interceptor.Fault: Could not initialize class org.springframework.jdbc.core.Statement
- hbase报错Could not initialize class org.apache.hadoop.hbase.protobuf.ProtobufUtil
- 大数据_Kafka_Storm_整合_Could not initialize class org.apache.log4j.Log4
- HDU 1695 数论 容斥 欧拉函数 || 莫比乌斯反演
- 调通sina33下的AP6212A0版本的BT(V1.0)
- 2017大预测:大数据、物联网与人工智能
- 美丽诗文
- 支持注解的Servlet3.0监听器
- Could not initialize class org.apache.log4j.Log4jLoggerFactory
- 剑指Offer——(32)把数组排成最小的数
- AFNetworking 文件断点上传详细解读
- jmeter 登录并发 (此文章有待修改)
- 剑指offer-左旋字符串
- WebServce查询免费的天气预报实例
- Nginx配置详解
- java 中什么时候用抽象类,什么时候用 接口(面向对象的继承与多态)
- C++类和对象