0

我正在使用 cloudera quickstart 在 java 中实现一个 hadoop 项目:我的 cloudera-quickstart 版本是 5.8.0 这里是错误消息:

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.
17/04/09 14:11:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
17/04/09 14:11:36 INFO Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
17/04/09 14:11:36 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonMappingException
    at org.apache.hadoop.mapreduce.Job.getJobSubmitter(Job.java:1291)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:1302)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1325)
    at StubDriver.main(StubDriver.java:41)
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 4 more 

我在这个简单的培训项目中检查了我的引用库,在 buildpath 库中,slf4j-api-1.6.1.jar;slf4j-api1.7.5.jar;slf4j-api.jar 都包括在内。

4

1 回答 1

1
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

除了slf4j-api罐子,slf4j-log4j12罐子也应该被添加。

Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException

您的项目缺少jackson-mapper-asljar。

这些 jars 已经作为 Hadoop 库的一部分提供。更新您的项目CLASSPATH以包含hadoop classpath将是最简单的解决方法。

于 2017-04-10T20:32:14.647 回答