java.lang.CompatibleClassChangeError:找到了类org.apache.hadoop.mapreduce.jobcontext,但需要接口

z31licg0  于 2021-06-04  发布在  Hadoop
关注(0)|答案(1)|浏览(404)

我在用 Sqoop 1.4.3hadoop 1.2.4 以及 hive 0.11.0 当我尝试做一个sqoop导入时:它吐了 IncompatibleClassChangeError. 有什么建议可以解决这个问题吗。。
使用的sqoop命令:

sqoop import --connect jdbc:mysql://localhost:3306/employees \
    --username test --password test

跟踪:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class org.apache.hadoop.mapreduce.JobContext, but interface was expected
        at org.apache.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:53)
        at com.cloudera.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:36)
        at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.getSplits(DataDrivenDBInputFormat.java:121)
        at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:1054)
        at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:1071)
        at org.apache.hadoop.mapred.JobClient.access$700(JobClient.java:179)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:983)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
        at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
        at org.apache.hadoop.mapreduce.Job.submit(Job.java:550)
        at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580)
        at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:173)
        at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:151)
        at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:221)
        at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:545)
        at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:111)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:403)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

有谁能建议我们可以配置哪个版本的sqoop来让它工作吗。。?

rkue9o1l

rkue9o1l1#

您遇到了版本冲突,很可能是在hadoop1.0和hadoop2.0上运行编译的代码。这是因为hadoop1.0和2.0基本上是不兼容的,所以您应该确保下载与hadoop发行版匹配的sqoop版本。
更多细节,请看这里。

相关问题