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

  1. 云栖社区>
  2. 博客>
  3. 正文

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

浦涛 2018-08-20 10:12:33 浏览1768
展开阅读全文
编译通过,打包时报如下错误 :
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库的依赖关系,把它排除掉不打包即可。

网友评论

登录后评论
0/500
评论
浦涛
+ 关注