日誌jar包衝突報錯:Class path contains multiple SLF4J bindings

  問題現象:tomcat啓動卡死,報錯日誌以下:html

十一月 07, 2017 8:35:45 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ms-notify/WEB-INF/lib/log4j-slf4j-impl-2.9.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ms-notify/WEB-INF/lib/slf4j-log4j12-1.7.2.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.apache.logging.slf4j.Log4jLoggerFactory]

  問題定位:從日誌裏看到兩個日誌jar包衝突了:log4j-slf4j-impl-2.9.1.jar和slf4j-log4j12-1.7.2.jarweb

  解決問題:根據日誌給出的本地tomcat路徑,進入到lib下,刪除其中一個,這裏進入E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ms-notify/WEB-INF/lib,刪除log4j-slf4j-impl-2.9.1.jar,重啓便可。apache

相關文章
相關標籤/搜索