yash
yash

Reputation: 51

Failed to load class org.slf4j.impl.StaticLoggerBinder and Unable to load native-hadoop library

I'm new with Hadoop and during one MapReduce task I got the following error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
15/09/18 07:31:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

How can I solve this?

Thanks!

Upvotes: 4

Views: 7473

Answers (1)

Dimitris Fasarakis Hilliard
Dimitris Fasarakis Hilliard

Reputation: 160687

Here's what your errors mean:

For SLF4J:

SLF4J: **Failed to load class** "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

As you can tell, you do not have the appropriate class (*Failed to load class*) for SLF4J to work so it defaults to no logging ((NOP) logger implementation). Following the suggested link you can see that the solution for this is:

Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem

For Hadoop:

15/09/18 07:31:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

This just means that the native library cannot be found, it generally doesn't affect the way Hadoop functions. As for the native library:

The native library just contains implementations of certain components for performance reasons and for non-availability of Java implementations. These components are available in a single, dynamically-linked native library called the native hadoop library. On the *nix platforms the library is named libhadoop.so.

Anyway, if you really want to get rid of the warning, you can follow one of the many solutions offered here.

Upvotes: 7

Related Questions