jar冲突问题:MVN package 时 SLF4J: Class path contains multiple SLF4J bindings 错误解决办法

编译通过,打包时报如下错误 :
19-Aug-2018 10:53:56.961 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/baseuser/apache-tomcat-8.5.3/webapps/ROOT/WEB-INF/lib/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/baseuser/apache-tomcat-8.5.3/webapps/ROOT/WEB-INF/lib/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
19-Aug-2018 10:53:57.061 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
19-Aug-2018 10:53:57.065 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors


在工程目录下用     mvn dependency:tree -P profile > dependency.txt  把工程的依赖关系导出为文件,

在文件中查找对slf4J和log4j库的依赖关系,把它排除掉不打包即可。

上一篇:asp.net mvc SelectList 的selected 失效及解决方案


下一篇:TCP粘包/拆包问题