1.问题描述:

springboot项目打成war包后,win10运行正常,linux运行异常,异常信息部分代码,查看tomcat日志:

07-May-2020 19:30:27.866 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /www/server/tomcat/webapps/xxx.war
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/www/server/tomcat/webapps/xxx/WEB-INF/lib/slf4j-log4j12-1.7.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/www/server/tomcat/webapps/xxx/WEB-INF/lib/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.Log4jLoggerFactory]
07-May-2020 19:30:29.224 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xxx-5.0.0]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)

由日志我们可以发现,大概是jar冲突,系统不知道取哪一个jar:

 

解决方案:删除 slf4j-log4j12-1.7.1.jar 重启即可