hadoop运行MapReduce WordCount$TokenizerMapper classNotFound

[root@cee-3 chinahadoop]# su hdfs hadoop jar target/cee-hadoop-0.0.1-SNAPSHOT.jar cee.bigdata.hadoop.week2.WordCount2 /tmp/test.txt /tmp/0010
16/08/18 20:47:26 INFO client.RMProxy: Connecting to ResourceManager at cee-1/10.163.160.239:8032
16/08/18 20:47:27 WARN mapreduce.JobSubmitter: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
16/08/18 20:47:27 WARN mapreduce.JobSubmitter: No job jar file set. User classes may not be found. See Job or Job#setJar(String).
16/08/18 20:47:27 INFO input.FileInputFormat: Total input paths to process : 1
16/08/18 20:47:28 INFO mapreduce.JobSubmitter: number of splits:1
16/08/18 20:47:28 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1471409583681_0004
16/08/18 20:47:29 INFO mapred.YARNRunner: Job jar is not present. Not adding any jar to the list of resources.
16/08/18 20:47:29 INFO impl.YarnClientImpl: Submitted application application_1471409583681_0004
16/08/18 20:47:29 INFO mapreduce.Job: The url to track the job: http://cee-1:8088/proxy/applic ... 0004/
16/08/18 20:47:29 INFO mapreduce.Job: Running job: job_1471409583681_0004
16/08/18 20:47:46 INFO mapreduce.Job: Job job_1471409583681_0004 running in uber mode : false
16/08/18 20:47:46 INFO mapreduce.Job: map 0% reduce 0%
16/08/18 20:47:58 INFO mapreduce.Job: Task Id : attempt_1471409583681_0004_m_000000_0, Status : FAILED
Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class cee.bigdata.hadoop.week2.WordCount2$TokenizerMapper not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2114)
at org.apache.hadoop.mapreduce.task.JobContextImpl.getMapperClass(JobContextImpl.java:196)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:745)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class cee.bigdata.hadoop.week2.WordCount2$TokenizerMapper not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2020)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2112)
... 8 more

16/08/18 20:48:08 INFO mapreduce.Job: Task Id : attempt_1471409583681_0004_m_000000_1, Status : FAILED
Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class cee.bigdata.hadoop.week2.WordCount2$TokenizerMapper not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2114)
at org.apache.hadoop.mapreduce.task.JobContextImpl.getMapperClass(JobContextImpl.java:196)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:745)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class cee.bigdata.hadoop.week2.WordCount2$TokenizerMapper not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2020)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2112)
... 8 more

16/08/18 20:48:15 INFO mapreduce.Job: Task Id : attempt_1471409583681_0004_m_000000_2, Status : FAILED
Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class cee.bigdata.hadoop.week2.WordCount2$TokenizerMapper not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2114)
at org.apache.hadoop.mapreduce.task.JobContextImpl.getMapperClass(JobContextImpl.java:196)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:745)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class cee.bigdata.hadoop.week2.WordCount2$TokenizerMapper not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2020)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2112)
... 8 more

16/08/18 20:48:24 INFO mapreduce.Job: map 100% reduce 100%
16/08/18 20:48:24 INFO mapreduce.Job: Job job_1471409583681_0004 failed with state FAILED due to: Task failed task_1471409583681_0004_m_000000
Job failed as tasks failed. failedMaps:1 failedReduces:0

16/08/18 20:48:25 INFO mapreduce.Job: Counters: 9
Job Counters
Failed map tasks=4
Launched map tasks=4
Other local map tasks=3
Data-local map tasks=1
Total time spent by all maps in occupied slots (ms)=129048
Total time spent by all reduces in occupied slots (ms)=0
Total time spent by all map tasks (ms)=32262
Total vcore-seconds taken by all map tasks=32262
Total megabyte-seconds taken by all map tasks=6452400
[root@cee-3 chinahadoop]#

wangxiaolei

赞同来自:

这段代码怎么写的Job.setJar(String) 是和类名保持一致的吗

要回复问题请先登录注册