2017-04-09 31 views
0

我使用Cloudera的快速入門使用Java實現的Hadoop項目時加載類: 我Cloudera的,快速入門版本是5.8.0 這裏的錯誤信息:無法與Cloudera的Hadoop的java培訓項目工作

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 

我在這個簡單的培訓項目中檢查了我的引用庫,在構建路徑庫slf4j-api-1.6.1.jar; SLF4J-api1.7.5.jar; slf4j-api.jar都包含在內。

回答

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-asl jar。

這些罐子已經作爲Hadoop庫的一部分提供。更新您的項目CLASSPATH以包括hadoop classpath將是最簡單的修復方法。