New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running spotbugs 4.7.2 with -textui flag results in org.apache.logging.slf4j.SLF4JServiceProvider
exception
#2176
Comments
Thanks for opening your first issue here! 😃 |
This is most likely since the upgrade to slf4j 2.0 in #2156
I think you need a log4j2 bridge compatible with slf4j 2 but I'm not sure if it is released yet |
I thought that the fault was in my system. |
Resolves spotbugs#2176 ``` Unexpected problem occured during version sanity check Reported exception: java.lang.AbstractMethodError: Receiver class org.apache.logging.slf4j.SLF4JServiceProvider does not define or inherit an implementation of the resolved method 'abstract java.lang.String getRequestedApiVersion()' of interface org.slf4j.spi.SLF4JServiceProvider. at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:297) ... ``` The issue is log4j 2.x broke compatibility (renamed method that had a grammatic typo) and slf4j-impl 2.18.0 still being on 1.x. 2.19.0 is now released with fix of https://issues.apache.org/jira/browse/LOG4J2-3139 Changing `log4j-slf4j18-impl` to `log4j-slf4j2-impl`, see https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html Adding explicit (runtime) dependency on log4j-core because `log4j-slf4j2-impl` doesn't have it and it'd otherwise cause ``` ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... ``` Tested with ```console $ rm ./spotbugs/.libs/* $ gradle assemble $ java -cp "./spotbugs/.libs/*:./spotbugs/build/libs/spotbugs.jar" edu.umd.cs.findbugs.LaunchAppropriateUI -textui ...log4j errors are not showing up now... ```
Resolves #2176 ``` Unexpected problem occured during version sanity check Reported exception: java.lang.AbstractMethodError: Receiver class org.apache.logging.slf4j.SLF4JServiceProvider does not define or inherit an implementation of the resolved method 'abstract java.lang.String getRequestedApiVersion()' of interface org.slf4j.spi.SLF4JServiceProvider. at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:297) ... ``` The issue is log4j 2.x broke compatibility (renamed method that had a grammatic typo) and slf4j-impl 2.18.0 still being on 1.x. 2.19.0 is now released with fix of https://issues.apache.org/jira/browse/LOG4J2-3139 Changing `log4j-slf4j18-impl` to `log4j-slf4j2-impl`, see https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html Adding explicit (runtime) dependency on log4j-core because `log4j-slf4j2-impl` doesn't have it and it'd otherwise cause ``` ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... ``` Tested with ```console $ rm ./spotbugs/.libs/* $ gradle assemble $ java -cp "./spotbugs/.libs/*:./spotbugs/build/libs/spotbugs.jar" edu.umd.cs.findbugs.LaunchAppropriateUI -textui ...log4j errors are not showing up now... ```
See the below output, this is with openJDK 11, the issue is not present in 4.7.1
The text was updated successfully, but these errors were encountered: