gpt4 book ai didi

java - 无法加载类 org.slf4j.impl.StaticLoggerBinder 和无法加载 native hadoop 库

转载 作者:可可西里 更新时间:2023-11-01 14:21:06 32 4
gpt4 key购买 nike

我是 Hadoop 的新手,在一次 MapReduce 任务中我遇到了以下错误:

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

我该如何解决这个问题?

谢谢!

最佳答案

以下是您的错误的含义:

对于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.

如您所知,您没有适当的类(*无法加载类*)让 SLF4J 正常工作,因此它默认为无日志记录((NOP) 记录器实现)。按照建议link您可以看到解决方案是:

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

对于 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

这只是找不到native library,一般不会影响Hadoop的运行方式。至于原生库:

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.

无论如何,如果您真的想要摆脱警告,您可以遵循提供的众多解决方案之一 here .

关于java - 无法加载类 org.slf4j.impl.StaticLoggerBinder 和无法加载 native hadoop 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32655157/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com