Found interface org.apache.hadoop.mapreduce.TaskAttemptContext Found interface org.apache.hadoop.mapreduce.TaskAttemptContext hadoop hadoop

Found interface org.apache.hadoop.mapreduce.TaskAttemptContext


The problem is that org.apache.hadoop.mapreduce.TaskAttemptContext was a class in Hadoop 1 but became an interface in Hadoop 2.

This is one of the reasons why libraries which depend on the Hadoop libs need to have separately compiled jarfiles for Hadoop 1 and Hadoop 2. Based on your stack trace, it appears that somehow you got a Hadoop1-compiled Avro jarfile, despite running with Hadoop 2.4.1.

The download mirrors for Avro provide nice separate downloadables for avro-mapred-1.7.7-hadoop1.jar vs avro-mapred-1.7.7-hadoop2.jar.


The problem is that Avro 1.7.7 supports 2 versions of Hadoop and hence depends on both Hadoop versions. And by default Avro 1.7.7 jars dependend on old Hadoop version. To build with Avro 1.7.7 with Hadoop2 just add extra classifier line to maven dependencies:

    <dependency>        <groupId>org.apache.avro</groupId>        <artifactId>avro-mapred</artifactId>        <version>1.7.7</version>        <classifier>hadoop2</classifier>    </dependency>

This will tell maven to search for avro-mapred-1.7.7-hadoop2.jar, not avro-mapred-1.7.7.jar

Same applicable for Avro 1.7.4 and above