Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar
来源:互联网 发布:瑞典王国 知乎 编辑:程序博客网 时间:2024/06/05 13:43
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError
SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.log4j.LogManager.getLogger(LogManager.java:44)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:66)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:277)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
....
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. See alsohttp://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
at org.apache.log4j.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:51)
... 11 more
原因是引用了两个关于log4j的jar,造成死循环
log4j-over-slf4j-1.7.7.jar
slf4j-log4j12-1.7.7.jar
但只引用slf4j-log4j12-1.7.7.jar会提示org.apache.log4j.Level这个class找不到
要使用log4j记录日志,其实只用引用log4j-over-slf4j-1.7.7.jar就可以了
- 用户更新的sql语句
- 基于Document机制的Swing IP地址控件
- 黑马视频学习笔记-while循环
- 时间格式化。
- opengl es 对bmp 文件贴图程序。
- Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar
- 【算法】 二叉树遍历
- POJ 1661 DP 注意边界条件。。。WA了好几次
- 上学的时候写的 魅族手机防盗程序
- Foursquare 8.0 :聪明人给互联网公司上的流量转化课
- Heavy Cargo(弗洛伊德——最小生成树)
- MYSQL用法(四) 存储过程插入10000条数据示例
- Makefile编写
- ISNULL的初学误区