slf4j提示找不到weblogic.xml日志异常

 

相关异常信息如下:

Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:~/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.Log4jLoggerFactory
    at org.springframework.util.Assert.instanceCheckFailed(Assert.java:696)
    at org.springframework.util.Assert.isInstanceOf(Assert.java:596)

关键信息

 

 

LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation……

 

此时,可用过查看maven依赖来排查问题,在项目跟目录执行如下命令:

mvn dependency:tree

显示如下

[INFO] +-

你可能感兴趣的:(解决问题)