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

JIRA | Yingmin LI | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    First compile mango-hadoop with command: ./gradlew jar -PclusterVersion='1.1' Here I suppose mango-hadoop jars will be compatible with hadoop 1.2.1 but I am not sure. Run example with command pig -x local examples/treasury_yield/pig/pig_mongo_test.pig, The error result is: java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected at com.mongodb.hadoop.MongoInputFormat.getSplits(MongoInputFormat.java:54) at org.apache.pig.impl.io.ReadToEndLoader.init(ReadToEndLoader.java:190) at org.apache.pig.impl.io.ReadToEndLoader.<init>(ReadToEndLoader.java:146) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.setUp(POLoad.java:95) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.getNextTuple(POLoad.java:123) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLimit.getNextTuple(POLimit.java:117) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getNextTuple(POStore.java:143) at org.apache.pig.backend.hadoop.executionengine.fetch.FetchLauncher.runPipeline(FetchLauncher.java:160) at org.apache.pig.backend.hadoop.executionengine.fetch.FetchLauncher.launchPig(FetchLauncher.java:81) at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.launchPig(HExecutionEngine.java:275) at org.apache.pig.PigServer.launchPlan(PigServer.java:1367) at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1352) at org.apache.pig.PigServer.storeEx(PigServer.java:1011) at org.apache.pig.PigServer.store(PigServer.java:974) at org.apache.pig.PigServer.openIterator(PigServer.java:887) at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:752) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:228) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:203) at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81) at org.apache.pig.Main.run(Main.java:608) at org.apache.pig.Main.main(Main.java:156) 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:160)

    JIRA | 2 years ago | Yingmin LI
    java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected
  2. 0

    First compile mango-hadoop with command: ./gradlew jar -PclusterVersion='1.1' Here I suppose mango-hadoop jars will be compatible with hadoop 1.2.1 but I am not sure. Run example with command pig -x local examples/treasury_yield/pig/pig_mongo_test.pig, The error result is: java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected at com.mongodb.hadoop.MongoInputFormat.getSplits(MongoInputFormat.java:54) at org.apache.pig.impl.io.ReadToEndLoader.init(ReadToEndLoader.java:190) at org.apache.pig.impl.io.ReadToEndLoader.<init>(ReadToEndLoader.java:146) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.setUp(POLoad.java:95) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.getNextTuple(POLoad.java:123) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLimit.getNextTuple(POLimit.java:117) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getNextTuple(POStore.java:143) at org.apache.pig.backend.hadoop.executionengine.fetch.FetchLauncher.runPipeline(FetchLauncher.java:160) at org.apache.pig.backend.hadoop.executionengine.fetch.FetchLauncher.launchPig(FetchLauncher.java:81) at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.launchPig(HExecutionEngine.java:275) at org.apache.pig.PigServer.launchPlan(PigServer.java:1367) at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1352) at org.apache.pig.PigServer.storeEx(PigServer.java:1011) at org.apache.pig.PigServer.store(PigServer.java:974) at org.apache.pig.PigServer.openIterator(PigServer.java:887) at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:752) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:228) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:203) at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81) at org.apache.pig.Main.run(Main.java:608) at org.apache.pig.Main.main(Main.java:156) 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:160)

    JIRA | 2 years ago | Yingmin LI
    java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected
  3. 0

    Getting Error while exeuting Pig script having integration with MongoDB

    Stack Overflow | 1 year ago | Pranav
    org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias data
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error: Found interface org.apache.hadoop.mapreduce.Counter, but class was expected

    GitHub | 2 years ago | gaohannk
    java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected

    Root Cause Analysis

    1. java.lang.IncompatibleClassChangeError

      Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected

      at com.mongodb.hadoop.MongoInputFormat.getSplits()
    2. com.mongodb.hadoop
      MongoInputFormat.getSplits
      1. com.mongodb.hadoop.MongoInputFormat.getSplits(MongoInputFormat.java:54)
      1 frame
    3. org.apache.pig
      Main.main
      1. org.apache.pig.impl.io.ReadToEndLoader.init(ReadToEndLoader.java:190)
      2. org.apache.pig.impl.io.ReadToEndLoader.<init>(ReadToEndLoader.java:146)
      3. org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.setUp(POLoad.java:95)
      4. org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.getNextTuple(POLoad.java:123)
      5. org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281)
      6. org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLimit.getNextTuple(POLimit.java:117)
      7. org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281)
      8. org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getNextTuple(POStore.java:143)
      9. org.apache.pig.backend.hadoop.executionengine.fetch.FetchLauncher.runPipeline(FetchLauncher.java:160)
      10. org.apache.pig.backend.hadoop.executionengine.fetch.FetchLauncher.launchPig(FetchLauncher.java:81)
      11. org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.launchPig(HExecutionEngine.java:275)
      12. org.apache.pig.PigServer.launchPlan(PigServer.java:1367)
      13. org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1352)
      14. org.apache.pig.PigServer.storeEx(PigServer.java:1011)
      15. org.apache.pig.PigServer.store(PigServer.java:974)
      16. org.apache.pig.PigServer.openIterator(PigServer.java:887)
      17. org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:752)
      18. org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
      19. org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:228)
      20. org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:203)
      21. org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81)
      22. org.apache.pig.Main.run(Main.java:608)
      23. org.apache.pig.Main.main(Main.java:156)
      23 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    5. Hadoop
      RunJar.main
      1. org.apache.hadoop.util.RunJar.main(RunJar.java:160)
      1 frame