Exception in thread “main” java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected

Issue:

While configuring Sqoop (Sqoop: Downloaded was 1.4.6) on HDFS (Hadoop: 2.7.2), I encountered the below error,

Exception in thread “main” java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected        at org.apache.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:65)        at com.cloudera.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:36)        at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.getSplits(DataDrivenDBInputFormat.java:125)

Cause:

Could be something to do with versions conflict between Sqoop and Hadoop

Resolution:

The version of Sqoop (1.4.6) that was downloaded was for Hadoop 1, so, you may have to pick the right version of Sqoop + Hadoop combination to overcome the issue.Below is the snapshot for your reference.

 

sqhd

 

This entry was posted in Hadoop, Sqoop. Bookmark the permalink.

2 Responses to Exception in thread “main” java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected

  1. @mohammadarifmustafa@gmail.com, thanks man, you save my day….

    Liked by 1 person

  2. kullai says:

    open oozie directory and check pom.xml file like below:

    hadoop-1

    false

    1.2.1
    1

    hadoop100

    hadoop-0.23

    false

    0.23.5
    0.23
    h2
    hadoop23

    hadoop-2

    true

    2.7.3
    2
    h2
    hadoop200
    1.9.13

    hadoop-3

    false

    3.0.0-SNAPSHOT
    3
    h2
    hadoop200
    1.9.13

    for example you are using hadoop 2.7.3 version make it “activeByDefault” is “true” like below

    true

    and save it and run below command .

    cd /opt/oozie-4.2.0/bin

    ./mkdistro.sh assembly:single -P hadoop-2 -D javaVersion=1.8 -D targetJavaVersion=1.8 -DskipTests -DadditionalJOption=-Xdoclint:none

    based on version you can change.

    Liked by 1 person

Leave a comment