zoukankan      html  css  js  c++  java
  • eclipse下提交job时报错mapred.JobClient: No job jar file set. User classes may not be found.

    windows下,连接远程集群,直接在eclipse里运行mapreduce作业时,

    错误信息:

    11/10/14 13:52:07 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
    11/10/14 13:52:07 WARN mapred.JobClient: No job jar file set.  User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
    11/10/14 13:52:07 INFO input.FileInputFormat: Total input paths to process : 5
    11/10/14 13:52:07 INFO mapred.JobClient: Running job: job_201110141041_0014
    11/10/14 13:52:08 INFO mapred.JobClient:  map 0% reduce 0%
    11/10/14 13:52:19 INFO mapred.JobClient: Task Id : attempt_201110141041_0014_m_000000_0, Status : FAILED
    java.lang.RuntimeException: java.lang.ClassNotFoundException: Finger$FingerMapper1
        at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:809)
        at org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:157)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:569)

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

    。。。。

    出错的原因就是找不到Mapper类和Reduce类。

    单机运行的时候是不会存在这个问题的,但是现在是提交到远程集群直接运行,就会出现问题了,

    解决办法:

    将本工程导出jar包,并将该jar包加载到项目的build path中,在提交程序前在Main函数中添加

    conf.set("mapred.jar", "loadforecast_utils.jar"); //其中loadforecast_utils.jar是你的导出的jar文件名。注意第一个参数不要拼写错了。

    重新运行问题解决!

  • 相关阅读:
    Spring AOP Capabilities and Goal
    CDI Features
    Java Design Patterns
    Connector for python
    Spring reference
    a+1、&a+1、*(a+1)、*(&a+1)、*(*(&a+1))的区别
    int **p和int *p
    Hibernate注解
    功能测试
    零售商商品管理系统代码节选
  • 原文地址:https://www.cnblogs.com/hewenwu/p/3789046.html
Copyright © 2011-2022 走看看