欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Class path contains multiple SLF4J bindings

程序员文章站 2024-01-28 18:19:04
...

项目启动的时候报错:

Connected to the target VM, address: '127.0.0.1:60585', transport: 'socket'
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/repository/org/slf4j/slf4j-simple/1.7.26/slf4j-simple-1.7.26.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.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]
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.SimpleLoggerFactory loaded from file:/D:/repository/org/slf4j/slf4j-simple/1.7.26/slf4j-simple-1.7.26.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.SimpleLoggerFactory
    at org.springframework.util.Assert.instanceCheckFailed(Assert.java:655)


根据提示之间搜索:slf4j-simple

Class path contains multiple SLF4J bindings

Class path contains multiple SLF4J bindings

然后排除它

Class path contains multiple SLF4J bindings

 

 

总结:根据错误提示是依赖有问题,根据错误提示,排除对应的依赖,解决!