(已解决)SLF4J: Class path contains multiple SLF4J bindings.错误

(已解决)SLF4J: Class path contains multiple SLF4J bindings.错误

问题

这个项目在之前导入的时候是没问题的,但是前几天idea激活的时候给搞崩了,所以就重新下了一个。在重新导入项目之后就出现了该问题。先看错误提示:

E:\JDK\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:F:\IntelliJ IDEA 2021.1\lib\idea_rt.jar=11953:F:\IntelliJ IDEA 2021.1\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath E:\JDK\jre\lib\agileai_common_1.1.0.jar;E:\JDK\jre\lib\ant.jar;E:\JDK\jre\lib\aopalliance-1.0.jar;E:\JDK\jre\lib\avalon-framework-4.0.jar;E:\JDK\jre\lib\axiom-dom-1.2.8.jar;E:\JDK\jre\lib\axiom-impl-1.2.8.jar;E:\JDK\jre\lib\batik-1.5-fop-0.20-5.jar;E:\JDK\jre\lib\cas-client-core-3.2.1.jar;E:\JDK\jre\lib\cas-client-integration-tomcat-common-3.2.1.jar;E:\JDK\jre\lib\cas-client-integration-tomcat-v7-3.2.1.jar;E:\JDK\jre\lib\ccpp-1.0.jar;E:\JDK\jre\lib\cglib-nodep-2.1_3.jar;E:\JDK\jre\lib\charsets.jar;E:\JDK\jre\lib\commons-attributes-api.jar;E:\JDK\jre\lib\commons-attributes-compiler.jar;E:\JDK\jre\lib\commons-beanutils.jar;E:\JDK\jre\lib\commons-codec-1.10.jar;E:\JDK\jre\lib\commons-collections-3.2.1.jar;E:\JDK\jre\lib\commons-dbcp.jar;E:\JDK\jre\lib\commons-dbutils-1.7.jar;E:\JDK\jre\lib\commons-digester-1.8.jar;E:\JDK\jre\lib\commons-fileupload-1.2.2.jar;E:\JDK\jre\lib\commons-io-2.0.1.jar;E:\JDK\jre\lib\commons-lang-2.6.jar;E:\JDK\jre\lib\commons-logging.jar;E:\JDK\jre\lib\commons-pool-1.5.5.jar;E:\JDK\jre\lib\deploy.jar;E:\JDK\jre\lib\dom4j-1.6.1.jar;E:\JDK\jre\lib\ecside.jar;E:\JDK\jre\lib\ehcache-2.9.0.jar;E:\JDK\jre\lib\ext\access-bridge-64.jar;E:\JDK\jre\lib\ext\cldrdata.jar;E:\JDK\jre\lib\ext\dnsns.jar;E:\JDK\jre\lib\ext\jaccess.jar;E:\JDK\jre\lib\ext\jfxrt.jar;E:\JDK\jre\lib\ext\localedata.jar;E:\JDK\jre\lib\ext\nashorn.jar;E:\JDK\jre\lib\ext\sunec.jar;E:\JDK\jre\lib\ext\sunjce_provider.jar;E:\JDK\jre\lib\ext\sunmscapi.jar;E:\JDK\jre\lib\ext\sunpkcs11.jar;E:\JDK\jre\lib\ext\zipfs.jar;E:\JDK\jre\lib\fop-0.20.5.jar;E:\JDK\jre\lib\freemarker.jar;E:\JDK\jre\lib\geronimo-javamail_1.4_spec-1.7.1.jar;E:\JDK\jre\lib\hotweb_core.jar;E:\JDK\jre\lib\htmlparser.jar;E:\JDK\jre\lib\httpasyncclient-4.1.jar;E:\JDK\jre\lib\httpclient-4.4.1.jar;E:\JDK\jre\lib\httpcore-4.4.1.jar;E:\JDK\jre\lib\httpcore-nio-4.4.1.jar;E:\JDK\jre\lib\ibatis-2.3.4.726.jar;E:\JDK\jre\lib\jackson-core-asl-1.9.13.jar;E:\JDK\jre\lib\jackson-jaxrs-1.8.4.jar;E:\JDK\jre\lib\jackson-mapper-asl-1.9.13.jar;E:\JDK\jre\lib\jasypt-1.9.2.jar;E:\JDK\jre\lib\javaws.jar;E:\JDK\jre\lib\javax.annotation-api-1.2.jar;E:\JDK\jre\lib\javax.servlet.jar;E:\JDK\jre\lib\javax.servlet.jsp.jar;E:\JDK\jre\lib\javax.ws.rs-api-2.0.1.jar;E:\JDK\jre\lib\jaxb-core-2.2.11.jar;E:\JDK\jre\lib\jaxb-impl-2.2.11.jar;E:\JDK\jre\lib\jaxb-xjc-2.2.11.jar;E:\JDK\jre\lib\jaxen-1.1-beta-7.jar;E:\JDK\jre\lib\jce.jar;E:\JDK\jre\lib\jcl-over-slf4j-1.7.12.jar;E:\JDK\jre\lib\jettison-1.3.7.jar;E:\JDK\jre\lib\jetty-continuation-8.1.15.v20140411.jar;E:\JDK\jre\lib\jfr.jar;E:\JDK\jre\lib\jfxswt.jar;E:\JDK\jre\lib\js.jar;E:\JDK\jre\lib\json_simple-1.1.jar;E:\JDK\jre\lib\jsp-api.jar;E:\JDK\jre\lib\jsse.jar;E:\JDK\jre\lib\jstl-1.1.2.jar;E:\JDK\jre\lib\jstl.jar;E:\JDK\jre\lib\jtds-1.3.1.jar;E:\JDK\jre\lib\jxl.jar;E:\JDK\jre\lib\log4j-1.2.5.jar;E:\JDK\jre\lib\management-agent.jar;E:\JDK\jre\lib\mvel2-2.1.3.Final.jar;E:\JDK\jre\lib\mysql-connector-java-5.1.22-bin.jar;E:\JDK\jre\lib\neethi-3.0.3.jar;E:\JDK\jre\lib\oauth-20100527.jar;E:\JDK\jre\lib\oauth-provider-20100527.jar;E:\JDK\jre\lib\ojdbc6.jar;E:\JDK\jre\lib\plugin.jar;E:\JDK\jre\lib\pluto-container-api-2.0.1.jar;E:\JDK\jre\lib\pluto-container-api-impl-2.0.1.jar;E:\JDK\jre\lib\pluto-container-driver-api-2.0.1.jar;E:\JDK\jre\lib\pluto-taglib-2.0.1.jar;E:\JDK\jre\lib\poi-2.5.1.jar;E:\JDK\jre\lib\portal-driver.jar;E:\JDK\jre\lib\portlet-api_2.0_spec-1.0.jar;E:\JDK\jre\lib\proxool-0.9.1.jar;E:\JDK\jre\lib\proxool-cglib.jar;E:\JDK\jre\lib\resources.jar;E:\JDK\jre\lib\rt.jar;E:\JDK\jre\lib\servlet-api.jar;E:\JDK\jre\lib\sitemesh-2.2.1.jar;E:\JDK\jre\lib\slf4j-api-1.7.12.jar;E:\JDK\jre\lib\slf4j-jdk14-1.7.12.jar;E:\JDK\jre\lib\spring-aop-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-beans-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-context-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-core-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-expression-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-jdbc-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-orm-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-orm-ibatis.jar;E:\JDK\jre\lib\spring-oxm-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-tx-4.1.6.RELEASE.jar;E:\JDK\jre\lib\spring-web-4.1.6.RELEASE.jar;E:\JDK\jre\lib\standard-1.1.2.jar;E:\JDK\jre\lib\standard.jar;E:\JDK\jre\lib\stax2-api-3.1.4.jar;E:\JDK\jre\lib\velocity-1.7.jar;E:\JDK\jre\lib\woodstox-core-asl-4.4.1.jar;E:\JDK\jre\lib\wsdl4j-1.6.3.jar;E:\JDK\jre\lib\wss4j-bindings-2.1.2.jar;E:\JDK\jre\lib\wss4j-policy-2.1.2.jar;E:\JDK\jre\lib\wss4j-ws-security-common-2.1.2.jar;E:\JDK\jre\lib\wss4j-ws-security-dom-2.1.2.jar;E:\JDK\jre\lib\wss4j-ws-security-policy-stax-2.1.2.jar;E:\JDK\jre\lib\wss4j-ws-security-stax-2.1.2.jar;E:\JDK\jre\lib\xalan-2.5.1.jar;E:\JDK\jre\lib\xbean.jar;E:\JDK\jre\lib\xbean_xpath.jar;E:\JDK\jre\lib\xercesImpl-2.6.1.jar;E:\JDK\jre\lib\xml-apis-2.0.2.jar;E:\JDK\jre\lib\xml-resolver-1.2.jar;E:\JDK\jre\lib\xmlschema-core-2.2.1.jar;E:\JDK\jre\lib\xmlsec-2.0.5.jar;F:\Javaproject\enterpriseSystem\CY\target\classes;E:\repository\org\springframework\boot\spring-boot-starter-web\1.5.4.RELEASE\spring-boot-starter-web-1.5.4.RELEASE.jar;E:\repository\org\springframework\boot\spring-boot-starter\1.5.4.RELEASE\spring-boot-starter-1.5.4.RELEASE.jar;E:\repository\org\springframework\boot\spring-boot-starter-logging\1.5.4.RELEASE\spring-boot-starter-logging-1.5.4.RELEASE.jar;E:\repository\ch\qos\logback\logback-classic\1.1.11\logback-classic-1.1.11.jar;E:\repository\ch\qos\logback\logback-core\1.1.11\logback-core-1.1.11.jar;E:\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;E:\repository\org\slf4j\jcl-over-slf4j\1.7.25\jcl-over-slf4j-1.7.25.jar;E:\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;E:\repository\org\slf4j\log4j-over-slf4j\1.7.25\log4j-over-slf4j-1.7.25.jar;E:\repository\org\springframework\spring-core\4.3.9.RELEASE\spring-core-4.3.9.RELEASE.jar;E:\repository\org\yaml\snakeyaml\1.17\snakeyaml-1.17.jar;E:\repository\org\springframework\boot\spring-boot-starter-tomcat\1.5.4.RELEASE\spring-boot-starter-tomcat-1.5.4.RELEASE.jar;E:\repository\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.15\tomcat-embed-websocket-8.5.15.jar;E:\repository\org\hibernate\hibernate-validator\5.3.5.Final\hibernate-validator-5.3.5.Final.jar;E:\repository\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;E:\repository\org\jboss\logging\jboss-logging\3.3.1.Final\jboss-logging-3.3.1.Final.jar;E:\repository\com\fasterxml\classmate\1.3.3\classmate-1.3.3.jar;E:\repository\com\fasterxml\jackson\core\jackson-databind\2.8.8\jackson-databind-2.8.8.jar;E:\repository\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;E:\repository\com\fasterxml\jackson\core\jackson-core\2.8.8\jackson-core-2.8.8.jar;E:\repository\org\springframework\spring-web\4.3.9.RELEASE\spring-web-4.3.9.RELEASE.jar;E:\repository\org\springframework\spring-aop\4.3.9.RELEASE\spring-aop-4.3.9.RELEASE.jar;E:\repository\org\springframework\spring-beans\4.3.9.RELEASE\spring-beans-4.3.9.RELEASE.jar;E:\repository\org\springframework\spring-context\4.3.9.RELEASE\spring-context-4.3.9.RELEASE.jar;E:\repository\org\springframework\spring-webmvc\4.3.9.RELEASE\spring-webmvc-4.3.9.RELEASE.jar;E:\repository\org\springframework\spring-expression\4.3.9.RELEASE\spring-expression-4.3.9.RELEASE.jar;E:\repository\com\alibaba\fastjson\1.2.47\fastjson-1.2.47.jar;E:\repository\org\springframework\boot\spring-boot-devtools\1.5.4.RELEASE\spring-boot-devtools-1.5.4.RELEASE.jar;E:\repository\org\springframework\boot\spring-boot\1.5.4.RELEASE\spring-boot-1.5.4.RELEASE.jar;E:\repository\org\springframework\boot\spring-boot-autoconfigure\1.5.4.RELEASE\spring-boot-autoconfigure-1.5.4.RELEASE.jar;E:\repository\org\apache\tomcat\embed\tomcat-embed-jasper\8.5.15\tomcat-embed-jasper-8.5.15.jar;E:\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.15\tomcat-embed-core-8.5.15.jar;E:\repository\org\apache\tomcat\embed\tomcat-embed-el\8.5.15\tomcat-embed-el-8.5.15.jar;E:\repository\org\eclipse\jdt\ecj\3.12.3\ecj-3.12.3.jar;E:\repository\javax\servlet\jstl\1.2\jstl-1.2.jar;E:\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.3.0\mybatis-spring-boot-starter-1.3.0.jar;E:\repository\org\springframework\boot\spring-boot-starter-jdbc\1.5.4.RELEASE\spring-boot-starter-jdbc-1.5.4.RELEASE.jar;E:\repository\org\apache\tomcat\tomcat-jdbc\8.5.15\tomcat-jdbc-8.5.15.jar;E:\repository\org\apache\tomcat\tomcat-juli\8.5.15\tomcat-juli-8.5.15.jar;E:\repository\org\springframework\spring-jdbc\4.3.9.RELEASE\spring-jdbc-4.3.9.RELEASE.jar;E:\repository\org\springframework\spring-tx\4.3.9.RELEASE\spring-tx-4.3.9.RELEASE.jar;E:\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.3.0\mybatis-spring-boot-autoconfigure-1.3.0.jar;E:\repository\org\mybatis\mybatis\3.4.4\mybatis-3.4.4.jar;E:\repository\org\mybatis\mybatis-spring\1.3.1\mybatis-spring-1.3.1.jar;E:\repository\mysql\mysql-connector-java\8.0.17\mysql-connector-java-8.0.17.jar;E:\repository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar cn.SpringBootDemoApplication
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/E:/JDK/jre/lib/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/E:/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.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.JDK14LoggerFactory]
Ignoring Class-Path entry xercesImpl-2.2.1.jar found inE:\JDK\jre\lib\fop-0.20.5.jar as E:\JDK\jre\lib\xercesImpl-2.2.1.jar does not exist
Ignoring Class-Path entry xml-apis.jar found inE:\JDK\jre\lib\fop-0.20.5.jar as E:\JDK\jre\lib\xml-apis.jar does not exist
Ignoring Class-Path entry xalan-2.4.1.jar found inE:\JDK\jre\lib\fop-0.20.5.jar as E:\JDK\jre\lib\xalan-2.4.1.jar does not exist
Ignoring Class-Path entry batik.jar found inE:\JDK\jre\lib\fop-0.20.5.jar as E:\JDK\jre\lib\batik.jar does not exist
Ignoring Class-Path entry jimi-1.0.jar found inE:\JDK\jre\lib\fop-0.20.5.jar as E:\JDK\jre\lib\jimi-1.0.jar does not exist
Ignoring Class-Path entry avalon-framework-cvs-20020806.jar found inE:\JDK\jre\lib\fop-0.20.5.jar as E:\JDK\jre\lib\avalon-framework-cvs-20020806.jar does not exist
Ignoring Class-Path entry jaxb-api.jar found inE:\JDK\jre\lib\jaxb-core-2.2.11.jar as E:\JDK\jre\lib\jaxb-api.jar does not exist
Ignoring Class-Path entry jaxb-core.jar found inE:\JDK\jre\lib\jaxb-impl-2.2.11.jar as E:\JDK\jre\lib\jaxb-core.jar does not exist
Ignoring Class-Path entry jaxb-core.jar found inE:\JDK\jre\lib\jaxb-xjc-2.2.11.jar as E:\JDK\jre\lib\jaxb-core.jar does not exist
Ignoring Class-Path entry jaxb-impl.jar found inE:\JDK\jre\lib\jaxb-xjc-2.2.11.jar as E:\JDK\jre\lib\jaxb-impl.jar does not exist
Ignoring Class-Path entry xercesImpl.jar found inE:\JDK\jre\lib\xalan-2.5.1.jar as E:\JDK\jre\lib\xercesImpl.jar does not exist
Ignoring Class-Path entry xml-apis.jar found inE:\JDK\jre\lib\xalan-2.5.1.jar as E:\JDK\jre\lib\xml-apis.jar does not exist
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: 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.JDK14LoggerFactory loaded from file:/E:/JDK/jre/lib/slf4j-jdk14-1.7.12.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.JDK14LoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext
	at org.springframework.util.Assert.isInstanceOf(Assert.java:339)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:274)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98)
	at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:230)
	at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:209)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
	at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
	at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:292)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
	at cn.SpringBootDemoApplication.main(SpringBootDemoApplication.java:28)
	... 5 more
java.lang.NoSuchFieldException: declaredFieldsCache
	at java.lang.Class.getDeclaredField(Class.java:2070)
	at org.springframework.boot.devtools.restart.Restarter.clear(Restarter.java:366)
	at org.springframework.boot.devtools.restart.Restarter.cleanupKnownCaches(Restarter.java:349)
	at org.springframework.boot.devtools.restart.Restarter.cleanupCaches(Restarter.java:338)
	at org.springframework.boot.devtools.restart.Restarter.access$000(Restarter.java:84)
	at org.springframework.boot.devtools.restart.Restarter$1.call(Restarter.java:175)
	at org.springframework.boot.devtools.restart.Restarter$1.call(Restarter.java:170)
	at org.springframework.boot.devtools.restart.Restarter$LeakSafeThread.run(Restarter.java:627)

从这两行代码中可以看出,是jdk中的库与maven本地库之间发生了冲突,所以才发生了一下报错。


SLF4J: Found binding in [jar:file:/E:/JDK/jre/lib/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/E:/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]

我首先找了网上的一下教程
https://blog.csdn.net/weixin_43761767/article/details/107327194,删除库之间的依赖,结果并不适用我的程序。

后来我们考虑到是不是idea导入的jdk版本与之前的不一样,所以我用了一种暴力的方法,使用idea重新下载一个jdk。

解决

(1)file- --project structure
在这里插入图片描述
(2)
在这里插入图片描述
(3)
在这里插入图片描述

(4)选择版本,我这里用的是1.8
在这里插入图片描述
最后成功运行!
在这里插入图片描述

总结

我这里用到的方法比较暴力,没有考虑到依赖关系,这里只是给大家提供一个解决思路。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值