日志包冲突
LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.apache.logging.slf4j.Log4jLoggerFactory loaded from file:/Users/yuqiu/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.17.0/log4j-slf4j-impl-2.17.0.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.apache.logging.slf4j.Log4jLoggerFactory
找到冲突jar包
Command+Alt+Shift+U查看依赖关系图
放大找到红线位置
也有可能没有红线,那就需要根据错误去找到冲突包,看是哪个引入的依赖包含的冲突包
排除依赖
根据冲突的包找到坐标排除依赖。查看依赖关系图发现依然存在依赖,重启idea,依赖消失。
<!-- Excel工具包 -->
<dependency>
<groupId>org.jxls</groupId>
<artifactId>jxls-jexcel</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
如果排除或者移除坐标后依赖关系图依然存在,重启idea即可。
如果这篇文章对你有用,可以关注本人微信公众号获取更多ヽ(^ω^)ノ ~