org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

时间:2023-03-09 14:54:44
org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

查看日志信息:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/app/apache-tomcat-docbase/mmsi/WEB-INF/lib/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/app/apache-tomcat-docbase/mmsi/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

解释:

SLF4J: 类路径包含多个SLF4J绑定

SLF4J: ——

SLF4J: ——

SLF4J: ——

SLF4J: 实际绑定的是类型[org.slf4j.impl.SimpleLoggerFactory]

解决办法,移除slf4j-simple-1.6.4.jar

如何发现该问题: