1

我有一个遗留的 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.
4

1 回答 1

3

尝试升级到 slf4j-log4j12-1.6.1.jar ,我遇到了同样的问题,它现在对我有用。

于 2014-02-09T14:48:49.360 回答