2013-10-14 62 views
1

我有一個遺留的Java EE應用程序,我正在移植到Maven框架。該應用程序最初使用slf4j 1.5x系列進行記錄,我正在升級到1.7.1記錄器。我在現場SLF4J讀取slf4j升級綁定更新錯誤?不兼容的綁定

http://slf4j.org/faq.html#where_is_binding

請注意,所有綁定依賴於SLF4J-api.jar文件。

我將slf4j-api.jar升級到1.7,並且使用slf4j-simple和slf4j-log4j12。我似乎仍然得到了一個不兼容的綁定錯誤,這非常坦率地把我拉上了牆。任何幫助,將不勝感激

INFO: validateJarFile(C:\Users\adam\apache-tomcat-7.0.42\webapps\ myWebApp\WEB-INF\lib\geronimo-servlet_2.5_spec-1.2.jar) - jar not loaded. 
See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 

Oct 14, 2013 1:57:42 PM org.apache.catalina.loader.WebappClassLoader validateJar 
File 
INFO: validateJarFile(C:\Users\adam\apache-tomcat-7.0.42\webapps\ myWebApp\WEB-INF\lib\servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 

Oct 14, 2013 1:57:42 PM org.apache.catalina.loader.WebappClassLoader validateJar 
File 
INFO: validateJarFile(C:\Users\adam\apache-tomcat-7.0.42\webapps\ myWebApp\WEB-INF\lib\servlet-api-2.5-6.1.11.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 

SLF4J: Class path contains multiple SLF4J bindings. 

SLF4J: Found binding in [jar:file:/C:/Users/adam/apache-tomcat-7.0.42/webapps/ 
myWebApp/WEB-INF/lib/slf4j-log4j12-1.5.0.jar!/org/slf4j/impl 
/StaticLoggerBinder.class] 

SLF4J: Found binding in [jar:file:/C:/Users/adam/apache-tomcat-7.0.42/webapps/ 
myWebApp/WEB-INF/lib/slf4j-simple-1.5.0.jar!/org/slf4j/impl/ 
StaticLoggerBinder.class] 

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 

SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding. 

SLF4J: Your binding is version 1.5.5 or earlier. 

SLF4J: Upgrade your binding to version 1.6.x. 
+2

此輸出告訴你哪些文件是舊版本。也許您已將新文件添加到您的版本,但您的Web應用程序部署仍使用舊版本(1.5.0)。 – mattx

+1

我懷疑你是對的,我不確定這是怎麼發生的,因爲我把所有依賴關係改爲1.7.1,我可能要檢查構建 – user1801279

+1

@ user1801279你的構建可能沒有從'lib中刪除舊副本'目錄。運行一個完整的清潔,並檢查他們是否顯示備份。 – chrylis

回答

3

嘗試升級到SLF4J-log4j12-1.6.1.jar,我有同樣的問題,,它現在爲我工作。