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 also http://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就可以了

http://www.360doc.com/content/10/0908/15/1542811_52121394.shtml

在最新的版本中,log4j-over-slf4j已经找不到了。现在以slf4j-log4j的jar为主

 https://www.slf4j.org/manual.html

 

时间: 2024-10-31 15:12:18

Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError的相关文章

Caused by: java.lang.IllegalStateException: Please login first!

问题描述 我已经登录过了,为什么发起聊天闪退,报这个错误 解决方案 判断下是否登录成功,登录成功才可以收发消息解决方案二:把全部的trace贴出来看一下!解决方案三:登录成功了没有解决方案四:遇到同样的错误,崩溃日志是E/AndroidRuntime(12248): java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.com.nggirl.nguser/com.iuxstudio.pumpkincarriag

Caused by: java.lang.IllegalStateException错误

问题描述 Caused by: java.lang.IllegalStateException错误 错误报的是Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. 说是代码:String time = cursor.g

android-为什么java.lang.IllegalStateException:没有事务挂起

问题描述 为什么java.lang.IllegalStateException:没有事务挂起 我开发了一个android应用程序.在大多数的手机设备上都可以正常运行.但是有些用户发送错误报告. java.lang.RuntimeException: An error occured while executing doInBackground()at android.os.AsyncTask$3.done(AsyncTask.java:200)at java.util.concurrent.Fu

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme

配置: 中设置theme为 <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:theme="@android:style/Theme.Light.NoTitleBar" android:label="@string/app_name" > 报错信息: 09-20 10:31:58.185 1392-1

【报错】spring整合activeMQ,pom.xml文件缺架包,启动报错:Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler

spring版本:4.3.13 ActiveMq版本:5.15 ======================================================== spring整合activeMQ,pom.xml文件缺架包,启动报错: [springDemo][INFO] [2017-12-11 14:54:57] org.springframework.web.context.ContextLoader.initWebApplicationContext(304) | Root

Caused by: java.lang.UnsatisfiedLinkError...问题的解决

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load BaiduMapVOS_v2_1_3: findLibrary returned null 在使用百度地图的时候碰到了这问题 网上搜了下各种方法 都不顶用 我想死的心都有了..有没有碰到过这问 题的 求分享下经验啊. 后来看了百度地图sdk的demo以后,是因为有一个文件 liblocSDK.so,必须放在 libs/armeabi 目录下.将其对应的 liblocSDK.so拷到相

客户端-代码出现 java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 21

问题描述 代码出现 java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 21 这行代码是ResponseObject> object=new GsonBuilder().create().fromJson(arg0.result, new TypeToken>>(){}.getType()); 求问什么原因有什么办法处理吗 解决方案 ResponseObject<

spring-Spring 启动报错java.lang.IllegalStateException

问题描述 Spring 启动报错java.lang.IllegalStateException java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue Nov 03 09:21:01 CS

接口-没有调用jsp页面java.lang.IllegalStateException

问题描述 没有调用jsp页面java.lang.IllegalStateException 调用接口返回值后,出席那这样的错误: java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServlet