When trying to run nutch trunk in eclipse, we often get a multiple slf4j binding error like the following.
SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/asmat/dev/trunk/build/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/asmat/dev/trunk/build/test/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] Usage: Injector <crawldb> <url_dir>
This is because SLF4J is designed to bind with only one underlying logging framework at a time. If there are more than one binding found, SLF4J will give error listing the locations where the multiple bindings exist.
To resolve this issue, we need to remove one of the bindings listed in the error message. In our case, trying to run Nutch in eclipse:
- right click on the nutch/trunk project and go to Build Path –> Configure Build Path
- Go to Java Build Path –> Libraries and look for slf4j-log4jxxx.jar – trunk/build/test/lib. Select and remove this library.
- Now click on Apply and Close and run your project again. You should see success message.
- Web Crawling and Data Mining with Apache Nutch
- Solr in Action
- Apache Solr: A Beginner Guide
- Apache Hadoop YARN