0

I am trying to test against Hadoop2 using MRUnit, but have been getting the following error:

java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.TaskInputOutputContext, but interface was expected

I have seen several other answers on Stack Overflow, but most have seemed related to issues stemming from including multiple configurations in the pom.xml file for Hadoop1 and Hadoop2.

Would anyone have any insight as to what might be causing this?

My pom.xml file is the following:

 <dependencies>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
    <groupId>com.github.davidmoten</groupId>
    <artifactId>geo</artifactId>
    <version>0.6.5</version>
</dependency>
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>activation</artifactId>
    <version>1.0.2</version>
</dependency>
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.2.11</version>
</dependency>
<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-core</artifactId>
    </dependency>   
<dependency>
    <groupId>org.apache.mrunit</groupId>
    <artifactId>mrunit</artifactId>
    <version>1.0.0</version>
    <classifier>hadoop2</classifier>
    <scope>test</scope>
</dependency>   

1 Answers1

2

This means you are not actually running on Hadoop 2. TaskInputOutputContext is an interface is 2.x, but it's saying it thinks it is a class.

In fact your pom.xml confirms this. hadoop-core is a 1.x artifact. You would be using things like hadoop-common in 2.x.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173