13.4 库依赖冲突问题:Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
来源:互联网 发布:联想有windows系统平板 编辑:程序博客网 时间:2024/06/06 03:45
13.4 库依赖冲突问题:Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
问题描述
引入第三方库'org.raml:raml-parser:0.8.12',导致slf4j依赖冲突。
java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
错误日志
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details. at org.slf4j.impl.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:54) ... 11 more:bootRun FAILED
Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
gradle -q app:dependencies
解决方案
排除冲突的依赖:
Maven:
<exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId></exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion></exclusions>
Gradle:
compile('org.raml:raml-parser:0.8.12'){ exclude module: 'slf4j-log4j12' exclude module: 'log4j'}
参考资料:
https://docs.gradle.org/current/userguide/userguide_single.html#sec:listing_dependencies
阅读全文
0 0
- 13.8 java.lang.IllegalArgumentException: Request header is too large
- the suspect
- 13.10 Scala中使用JSON.toJSONString报错:ambiguous reference to overloaded definition
- Python eval 函数妙用(转)
- 13.9 SpringBoot集成Swagger2中遇到的问题
- 13.4 库依赖冲突问题:Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
- 润乾报表v5如何升级设计器的JDK版本
- 13.11 Scala混用Java的集合类调用scala的foreach遍历问题
- OSG的几个矩阵
- 9月12日云栖精选夜读:人工智能在细分及新兴领域的应用
- 13.12 Spring Boot集成Security中遇到的问题
- 13.13 java.util.ConcurrentModificationException
- mongodb 中的like 怎么使用
- hadoop实战随笔_0721