slf4j升级绑定更新错误?不兼容的绑定

时间:2013-10-14 18:25:14

标签: java apache logging tomcat7 slf4j

我有一个遗留的Java EE应用程序,我正在移植到maven框架。该应用程序最初使用slf4j 1.5x系列进行日志记录,我正在升级到1.7.1记录器。我在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.

1 个答案:

答案 0 :(得分:3)

尝试升级到slf4j-log4j12-1.6.1.jar,我遇到了同样的问题,它现在正在为我工​​作。