Support Questions
Find answers, ask questions, and share your expertise

Sqoop import error - Exception in thread "main" java.lang.IncompatibleClassChangeError

Highlighted

Sqoop import error - Exception in thread "main" java.lang.IncompatibleClassChangeError

New Contributor

Hi 

 

I installed sqoop 1.4.4 on hadoop 2.7.1 and trying to import the table student from mysql to hdfs using sqoop import command.

 

I tried initially with sqoop 1.4.6 but I was getting the following error. I then tried with 1.4.4 and even getting the same error and I couldn't find the way to resolve it. Could any one please help me. Thanks in advance.

 

Below is the command I used.

 

sqoop import --connect jdbc:mysql://localhost/sqoop --username root -P --table student -m 1
Warning: /usr/lib/hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /usr/lib/hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Enter password:
16/01/15 18:24:06 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
16/01/15 18:24:06 INFO tool.CodeGenTool: Beginning code generation
16/01/15 18:24:08 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `student` AS t LIMIT 1
16/01/15 18:24:08 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `student` AS t LIMIT 1
16/01/15 18:24:08 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/hadoop
Note: /tmp/sqoop-rahul/compile/c58dc4b5daab3776f2a0d985356ecb1d/student.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
16/01/15 18:24:10 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-rahul/compile/c58dc4b5daab3776f2a0d985356ecb1d/student.jar
16/01/15 18:24:10 WARN manager.MySQLManager: It looks like you are importing from mysql.
16/01/15 18:24:10 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
16/01/15 18:24:10 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
16/01/15 18:24:10 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
16/01/15 18:24:10 INFO mapreduce.ImportJobBase: Beginning import of student
16/01/15 18:24:10 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
16/01/15 18:24:11 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/01/15 18:24:11 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
16/01/15 18:24:12 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
16/01/15 18:24:13 INFO Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
16/01/15 18:24:13 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
16/01/15 18:24:13 INFO mapreduce.JobSubmitter: Cleaning up the staging area file:/app/hadoop/tmp/mapred/staging/rahul1000138127/.staging/job_local1000138127_0001
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: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.mapreduce.JobSubmitter.writeNewSplits(JobSubmitter.java:301)
at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:318)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:196)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1308)
at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:186)
at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:159)
at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:239)
at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:600)
at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:118)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:413)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
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)