一次诡异的LOG4J冲突

使用SPRINGBOOT启动项目时报错

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/E:/Maven/repo/org/slf4j/slf4j-simple/1.7.26/slf4j-simple-1.7.26.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/E:/Maven/repo/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:/E:/Maven/repo/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
 

看了maven依赖关系图正常,最后发现是微信依赖



    com.github.wxpay
    wxpay-sdk
    0.0.3

里面和别的jar包冲突,改为



    com.github.wxpay
    wxpay-sdk
    0.0.3
    
        
            org.slf4j
            slf4j-simple
        
    

后正常使用

此问题比较诡异的地方是,同一个idea版本,有些人会遇到,有些人遇不到,暂时没找到原因

你可能感兴趣的:(自己遇到的BUG)