NoClassDefFoundError,无法运行MapReduceColorCount(Avro 1.7.7) [英] NoClassDefFoundError, cannot run MapReduceColorCount (Avro 1.7.7)

查看:106
本文介绍了NoClassDefFoundError,无法运行MapReduceColorCount(Avro 1.7.7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图运行基于网页 http:/http://www.google.com/support/bin/answer.py?hl=zh_CN/的MapReduceColorCount(新的MapReduce API)时, /avro.apache.org/docs/1.7.7/mr.html ,我收到以下内容:

When trying to run MapReduceColorCount (new MapReduce API) based on webpage http://avro.apache.org/docs/1.7.7/mr.html, I get the following:

[cloudera@localhost ~]$ hadoop jar avroColorCount.jar exos.MapReduceColorCount2 inavro01 outavro01
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avro/mapreduce/AvroKeyInputFormat
    at exos.MapReduceColorCount2.run(MapReduceColorCount2.java:71)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
    at exos.MapReduceColorCount2.main(MapReduceColorCount2.java:86)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

对于MRv1版本的代码,我得到了AvroMapper的NoClassDefFoundError。
对于我测试过的其他Avro程序,我得到了与AvroJob相同的错误。

For the MRv1 version of the code I get a NoClassDefFoundError for AvroMapper. For other Avro programs I've tested I get the same error for AvroJob.

你知道导致这类错误的根源吗?
注意:无法粘贴我的POM文件,显示非常糟糕,试图在代码引用之间进行尝试,但无法正常工作。

Do you know the root cause for these kinds of errors ? Note: could not paste my POM file, display was horrible, tried between code quotes but didn't work.

推荐答案

下载 avro-mapred-1.7.1.jar 并将其添加到您的类路径中。

Download the avro-mapred-1.7.1.jar and add it to your classpath.

这篇关于NoClassDefFoundError,无法运行MapReduceColorCount(Avro 1.7.7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆