Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

I'm trying to import data from mysql to HDFS using sqoop I'm getting below error please help me on this and I'm using Hadoop 2.6.5 version and SQOOP 1.4.6

Highlighted

I'm trying to import data from mysql to HDFS using sqoop I'm getting below error please help me on this and I'm using Hadoop 2.6.5 version and SQOOP 1.4.6

New Contributor
	18/11/30 22:51:02 INFO db.DBInputFormat: Using read commited transaction isolation
18/11/30 22:51:02 INFO mapreduce.JobSubmitter: Cleaning up the staging area /tmp/hadoop-yarn/staging/veera/.staging/job_1543635725264_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:65)
at com.cloudera.sqoop.config.ConfigurationHelper.getJobNumMaps(ConfigurationHelper.java:36)
at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.getSplits(DataDrivenDBInputFormat.java:125)
at org.apache.hadoop.mapreduce.JobSubmitter.writeNewSplits(JobSubmitter.java:302)
at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:319)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:197)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1297)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1294)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1294)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1315)
at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:196)
at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:169)
at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:266)
at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:673)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:497)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
4 REPLIES 4

Re: I'm trying to import data from mysql to HDFS using sqoop I'm getting below error please help me on this and I'm using Hadoop 2.6.5 version and SQOOP 1.4.6

New Contributor

Hi @Veera Mundra,

Could you please provide step by step how you are performing this import?

Regards,

AQ

Re: I'm trying to import data from mysql to HDFS using sqoop I'm getting below error please help me on this and I'm using Hadoop 2.6.5 version and SQOOP 1.4.6

New Contributor

Hi @aquilodran,

1. Hadoop Started .

2. I run the below sqoop command

sqoop import --bindir $SQOOP_HOME/lib --connect jdbc:mysql://bigdata:3306/testDb --driver com.mysql.jdbc.Driver --username root --password root --table student -m 1 --target-dir /usr/sqoop/

---> once I run the this command i'm getting below error.

Warning: /usr/lib/hbase does not exist! HBase imports will fail. Please set $HBASE_HOME to the root of your HBase installation. 18/12/05 21:43:45 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 18/12/05 21:43:45 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time. 18/12/05 21:43:45 INFO manager.SqlManager: Using default fetchSize of 1000 18/12/05 21:43:45 INFO tool.CodeGenTool: Beginning code generation Wed Dec 05 21:43:46 EST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 18/12/05 21:43:46 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t WHERE 1=0 18/12/05 21:43:46 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t WHERE 1=0 18/12/05 21:43:46 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/hadoop Note: /usr/local/sqoop/lib/student.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 18/12/05 21:43:47 INFO orm.CompilationManager: Writing jar file: /usr/local/sqoop/lib/student.jar 18/12/05 21:43:47 INFO mapreduce.ImportJobBase: Beginning import of student 18/12/05 21:43:47 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address 18/12/05 21:43:48 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar 18/12/05 21:43:48 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t WHERE 1=0 18/12/05 21:43:48 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps 18/12/05 21:43:48 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032 Wed Dec 05 21:43:53 EST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 18/12/05 21:43:53 INFO mapreduce.JobSubmitter: Cleaning up the staging area /tmp/hadoop-yarn/staging/veera/.staging/job_1544064131339_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:302) at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:319) at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:197) at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1297) at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1294) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692) at org.apache.hadoop.mapreduce.Job.submit(Job.java:1294) at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1315) 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.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: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)

Please help me on this.

Re: I'm trying to import data from mysql to HDFS using sqoop I'm getting below error please help me on this and I'm using Hadoop 2.6.5 version and SQOOP 1.4.6

New Contributor

Hi @Veera Mundra,

By any chance do you have multiple version of Sqoop binaries installed to your host?

I found a very similar thread which might be related to your issue: https://pradeepvattem.wordpress.com/2017/03/22/exception-in-thread-main-java-lang-incompatibleclassc.../

Regards,

AQ

Re: I'm trying to import data from mysql to HDFS using sqoop I'm getting below error please help me on this and I'm using Hadoop 2.6.5 version and SQOOP 1.4.6

New Contributor

HI @aquilodran did you get the steps to perform import from mysql to hdfs using java? If yes can you please help me, my email id is henilshelat@gmail.com