java.lang.RuntimeException: java.lang.ClassNotFoundException: cmd.CmdWordCount$MyMapper解決方法

14/02/28 20:29:48 INFO mapred.JobClient: Task Id : attempt_201402281833_0004_m_000000_1, Status : FAILED java

java.lang.RuntimeException: java.lang.ClassNotFoundException: cmd.CmdWordCount$MyMapper apache

at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:849) app

at org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:199) oop

at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:719) .net

at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370) orm

at org.apache.hadoop.mapred.Child$4.run(Child.java:255) hadoop

at java.security.AccessController.doPrivileged(Native Method) get

at javax.security.auth.Subject.doAs(Subject.java:396) cmd

at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149) it

at org.apache.hadoop.mapred.Child.main(Child.java:249)

Caused by: java.lang.ClassNotFoundException: cmd.CmdWordCount$MyMapper

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:247)

at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:802)

at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:847)

... 8 more

 

沒有設置jar包運行類致使,jar包運行方式必須設置。

job.setJarByClass(CmdWordCount.class);

相關文章
相關標籤/搜索