Chinaunix首页 | 论坛 | 博客
  • 博客访问: 302490
  • 博文数量: 22
  • 博客积分: 674
  • 博客等级: 上士
  • 技术积分: 792
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-19 00:48
文章存档

2013年(2)

2012年(20)

我的朋友

分类: 云计算

2012-04-13 19:47:56

  最近一直在研究MR作业的问题,在《Hadoop开发者第四期》中运行实例时遇到了如下问题,这个问题还比较常见,乍一看写的源码才发现了问题的所在,首先将错误log贴出:

点击(此处)折叠或打开

  1. 2012-04-13 19:38:07,940 WARN mapred.JobClient - No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
  2. 2012-04-13 19:38:07,956 INFO input.FileInputFormat - Total input paths to process : 1
  3. 2012-04-13 19:38:08,661 INFO mapred.JobClient - Running job: job_201204121502_0021
  4. 2012-04-13 19:38:09,664 INFO mapred.JobClient - map 0% reduce 0%
  5. 2012-04-13 19:38:15,683 INFO mapred.JobClient - Task Id : attempt_201204121502_0021_m_000000_0, Status : FAILED
  6. java.lang.RuntimeException: java.lang.ClassNotFoundException: com.loogn.cache.JoinWithDistribute$JoinMapper
  7.     at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:996)
  8.     at org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:212)
  9.     at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:602)
  10.     at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323)
  11.     at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
  12.     at java.security.AccessController.doPrivileged(Native Method)
  13.     at javax.security.auth.Subject.doAs(Subject.java:396)
  14.     at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157)
  15.     at org.apache.hadoop.mapred.Child.main(Child.java:264)
  16. Caused by: java.lang.ClassNotFoundException: com.loogn.cache.JoinWithDistribute$JoinMapper
  17.     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  18.     at java.security.AccessController.doPrivileged(Native Method)
  19.     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  20.     at java.lang.ClassLoader.loadClass(Clas
  21. 2012-04-13 19:38:20,792 INFO mapred.JobClient - Task Id : attempt_201204121502_0021_m_000000_1, Status : FAILED
  22. java.lang.RuntimeException: java.lang.ClassNotFoundException: com.loogn.cache.JoinWithDistribute$JoinMapper
  23.     at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:996)
  24.     at org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:212)
  25.     at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:602)
  26.     at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323)
  27.     at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
  28.     at java.security.AccessController.doPrivileged(Native Method)
  29.     at javax.security.auth.Subject.doAs(Subject.java:396)
  30.     at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157)
  31.     at org.apache.hadoop.mapred.Child.main(Child.java:264)
  32. Caused by: java.lang.ClassNotFoundException: com.loogn.cache.JoinWithDistribute$JoinMapper
  33.     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  34.     at java.security.AccessController.doPrivileged(Native Method)
  35.     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  36.     at java.lang.ClassLoader.loadClass(Clas
  37. 2012-04-13 19:38:25,873 INFO mapred.JobClient - Task Id : attempt_201204121502_0021_m_000000_2, Status : FAILED
  38. java.lang.RuntimeException: java.lang.ClassNotFoundException: com.loogn.cache.JoinWithDistribute$JoinMapper
  39.     at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:996)
  40.     at org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:212)
  41.     at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:602)
  42.     at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323)
  43.     at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
  44.     at java.security.AccessController.doPrivileged(Native Method)
  45.     at javax.security.auth.Subject.doAs(Subject.java:396)
  46.     at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157)
  47.     at org.apache.hadoop.mapred.Child.main(Child.java:264)
  48. Caused by: java.lang.ClassNotFoundException: com.loogn.cache.JoinWithDistribute$JoinMapper
  49.     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  50.     at java.security.AccessController.doPrivileged(Native Method)
  51.     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  52.     at java.lang.ClassLoader.loadClass(Clas
  错误为: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).这是因为在写MR作业配置时出了问题,将

点击(此处)折叠或打开

  1. conf.set("mapred.jar", jarFile.toString());
中的第一个参数人为地输入错了,在开始时写入是conf.set("mared",jarFile.toString());导致在运行作业时,无法上传jar到集群中,从而分布式系统提示找不到Map类,从而导致整个作业无法完成。
阅读(1952) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~