无法使用gora0.5和mongodb作为后端数据存储在hadoop2.4.0上运行nutch2.3-snapshot

x6492ojm  于 2021-05-30  发布在  Hadoop
关注(0)|答案(0)|浏览(240)

我碰到这个问题有几天了。当我使用hadoop1.2时,它可以正常工作。当我转向hadoop2.x(hadoop2.4或hadoop2.5.2)时,我遇到了这个问题:

java.lang.Exception: java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.TaskAttemptContext, but class was expected
    at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.TaskAttemptContext, but class was expected
    at org.apache.gora.mapreduce.GoraOutputFormat.getRecordWriter(GoraOutputFormat.java:83)
    at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.<init>(MapTask.java:624)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:744)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:340)
    at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

我发现当我在 ivy.xml ,它将产生 hadoop-core-1.0.1.jar 自然而然地,它似乎受到了哥拉的依赖性的影响。排除hadoop核心-*之后,就会出现这个问题!我还更新了jar文件 avro-mapre-1.7.6.jaravro-mapred-1.7.6-hadoop2.jar 用手,可惜什么都没变!任何想法都将不胜感激,谢谢!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题