• 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.lang.RuntimeException: java.lang.ClassNotFoundException: cmd.CmdWordCount$MyMapper

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

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

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

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

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

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

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

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

    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);

  • 相关阅读:
    国内最火的3款前端开发框架
    Cordova是做什么的
    老师你好。使用cordova生成的hellowold 的安卓5.0版本太高。怎么才可以生成4.4的呢?
    一个类似bootstrap的foundation
    role在标签中的作用是什么?
    如何做到根据不同的进度用不同的颜色显示整个进度条
    wall 和panel有啥区别
    git ignore
    eclipse js 引用跳转
    计划
  • 原文地址:https://www.cnblogs.com/luguoyuanf/p/3594456.html
Copyright © 2020-2023  润新知