GiraffaFS / giraffa

Giraffa FileSystem (Slack: giraffa-fs.slack.com)
https://giraffa.ci.cloudbees.com
Apache License 2.0
17 stars 6 forks source link

Fix SLF4J 'Multiple Bindings' error #165

Closed milandesai closed 8 years ago

milandesai commented 9 years ago

Running the Giraffa client results in the following harmless but long and annoying error:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/Milan/hadoop/hadoop-2.5.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Milan/giraffa/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

The problem is that SLF4J wants a single path to an implementation jar (in our case, slf4j-log4j) to appear in the class path. Since the client scripts delegate to the Hadoop scripts, which add the external Hadoop jars and dependencies - including slf4j-log4j - to the class path, we should exclude our own slf4j-log4j jar from the class path. That should resolve the message.

milandesai commented 9 years ago

Excluded slf4j-log4j jar from classpath, except when running giraffa format. Also removed the other echo statements that unnecessarily print out each time we run giraffa fs. Now what's printed out is exactly the same as in HDFS.

shvachko commented 8 years ago

Looks good +1

milandesai commented 8 years ago

Committed to trunk as 36dd309c2044284d6ab7e1b348bd072cc7beb82a.