User-Agent: Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5 Build Identifier: The presence of org.slf4j.impl.StaticLoggerBinder in slf4j api.jar causes warnings or a failure, depending on the classpath order. Upstream slf4j-api.jar does not include this class. Reproducible: Always Steps to Reproduce: Run a java program which uses slf4j, with /usr/share/java/slf4j/api.jar and (say) /usr/share/java/slf4j/simple.jar on the classpath. HelloWorld will do: 1. create HelloWorld.java (from http://www.slf4j.org/manual.html): import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HelloWorld { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(HelloWorld.class); logger.info("Hello World"); } } 2. javac -cp /usr/share/java/slf4j/api.jar HelloWorld.java 3. java -cp /usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/simple.jar:. HelloWorld 4. java -cp /usr/share/java/slf4j/simple.jar:/usr/share/java/slf4j/api.jar:. HelloWorld Actual Results: If api.jar is first in the classpath, an exception occurs with this message: This code should have never made it into the jar If another slf4j binding (sample.jar) is ahead of api.jar, there is no exception, but slf4j outputs this warning: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/share/java/slf4j/simple.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/slf4j/api.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. Expected Results: It should just output this: 0 [main] INFO HelloWorld - Hello World Version: slf4j-1.5.8-7.el6 The message "This code should have never made it into the jar" comes from the version of StaticLoggerBinder in api.jar.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-1239.html