我有一个遗留的 Java EE 应用程序,我正在将其移植到 Maven 框架。该应用程序最初使用 slf4j 1.5x 系列进行日志记录,我正在升级到 1.7.1 记录器。我在 slf4j 网站上看到
http://slf4j.org/faq.html#where_is_binding
Please note that all bindings depend on slf4j-api.jar.
我将我的 slf4j-api.jar 升级到 1.7 并使用了 slf4j-simple 和 slf4j-log4j12。我似乎仍然遇到不兼容绑定(bind)的错误,坦率地说,这让我陷入困境。任何帮助将不胜感激
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.
最佳答案
尝试升级到 slf4j-log4j12-1.6.1.jar ,我遇到了同样的问题,它现在对我有用。
关于java - slf4j 升级绑定(bind)更新错误?不兼容的绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19366687/