我正在使用 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 都包括在内。