sqoop导入失败java.lang.exception:java.lang.runtimeexception:java.lang.classnotfoundexception:class queryresult not found

ltskdhd1  于 2021-07-13  发布在  Hadoop
关注(0)|答案(0)|浏览(700)

我试图导入数据使用sqoop以下是我的sqoop导入命令。由于这个错误,我无法将数据导入hadoop集群。当我们发出sqoop import命令时,请告诉我sqoop是如何加载临时创建的jar文件的。
当我传递带有上一次执行(sqoop import)的临时创建的jar文件的-libjars时,import工作正常。

sqoop import --connect jdbc:mysql://192.168.0.98:3306/test --driver com.mysql.jdbc.Driver --username root -P  --e "select * from emailstatus where \$CONDITIONS" -m 1 -target-dir testdata/mysqldata -delete-target-dir --verbose

我在尝试从sqoop导入时遇到以下错误。

2021-03-16 20:38:55,485 INFO db.DBInputFormat: Using read commited transaction isolation
2021-03-16 20:38:55,514 INFO mapreduce.JobSubmitter: number of splits:1
2021-03-16 20:38:55,728 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_local300046907_0001
2021-03-16 20:38:55,728 INFO mapreduce.JobSubmitter: Executing with tokens: []
2021-03-16 20:38:55,861 INFO mapred.LocalDistributedCacheManager: Creating symlink: /opt/tmp/hadoop-root/mapred/local/job_local300046907_0001_62f1e8e0-00bb-412a-bd2d-73def8f48d80/libjars <- /tmp/sqoop-root/compile/6bca05fdb3320367f23b65f790ecc8af/libjars/*
2021-03-16 20:38:55,863 WARN fs.FileUtil: Command 'ln -s /opt/tmp/hadoop-root/mapred/local/job_local300046907_0001_62f1e8e0-00bb-412a-bd2d-73def8f48d80/libjars /tmp/sqoop-root/compile/6bca05fdb3320367f23b65f790ecc8af/libjars/*' failed 1 with: ln: failed to create symbolic link ‘/tmp/sqoop-root/compile/6bca05fdb3320367f23b65f790ecc8af/libjars/*’: No such file or directory

2021-03-16 20:38:55,863 WARN mapred.LocalDistributedCacheManager: Failed to create symlink: /opt/tmp/hadoop-root/mapred/local/job_local300046907_0001_62f1e8e0-00bb-412a-bd2d-73def8f48d80/libjars <- /tmp/sqoop-root/compile/6bca05fdb3320367f23b65f790ecc8af/libjars/*
2021-03-16 20:38:55,863 INFO mapred.LocalDistributedCacheManager: Localized file:/tmp/hadoop/mapred/staging/root300046907/.staging/job_local300046907_0001/libjars as file:/opt/tmp/hadoop-root/mapred/local/job_local300046907_0001_62f1e8e0-00bb-412a-bd2d-73def8f48d80/libjars
2021-03-16 20:38:55,906 INFO mapreduce.Job: The url to track the job: http://localhost:8080/
2021-03-16 20:38:55,907 INFO mapreduce.Job: Running job: job_local300046907_0001
2021-03-16 20:38:55,908 INFO mapred.LocalJobRunner: OutputCommitter set in config null
2021-03-16 20:38:55,914 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 2
2021-03-16 20:38:55,914 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
2021-03-16 20:38:55,915 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
2021-03-16 20:38:55,945 INFO mapred.LocalJobRunner: Waiting for map tasks
2021-03-16 20:38:55,945 INFO mapred.LocalJobRunner: Starting task: attempt_local300046907_0001_m_000000_0
2021-03-16 20:38:55,963 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 2
2021-03-16 20:38:55,964 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
2021-03-16 20:38:55,975 INFO mapred.Task:  Using ResourceCalculatorProcessTree : [ ]
2021-03-16 20:38:55,988 INFO db.DBInputFormat: Using read commited transaction isolation
2021-03-16 20:38:55,991 INFO mapred.MapTask: Processing split: 1=1 AND 1=1
2021-03-16 20:38:55,995 INFO mapred.LocalJobRunner: map task executor complete.
2021-03-16 20:38:55,997 WARN mapred.LocalJobRunner: job_local300046907_0001
java.lang.Exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class QueryResult not found
        at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:492)
        at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:552)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class QueryResult not found
        at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2638)
        at org.apache.sqoop.mapreduce.db.DBConfiguration.getInputClass(DBConfiguration.java:403)
        at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.createDBRecordReader(DataDrivenDBInputFormat.java:270)
        at org.apache.sqoop.mapreduce.db.DBInputFormat.createRecordReader(DBInputFormat.java:266)
        at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:527)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:770)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347)
        at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:271)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Class QueryResult not found
        at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2542)
        at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2636)
        ... 12 more
2021-03-16 20:38:56,911 INFO mapreduce.Job: Job job_local300046907_0001 running in uber mode : false
2021-03-16 20:38:56,912 INFO mapreduce.Job:  map 0% reduce 0%
2021-03-16 20:38:56,914 INFO mapreduce.Job: Job job_local300046907_0001 failed with state FAILED due to: NA
2021-03-16 20:38:56,919 INFO mapreduce.Job: Counters: 0
2021-03-16 20:38:56,923 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
2021-03-16 20:38:56,924 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 1.7468 seconds (0 bytes/sec)
2021-03-16 20:38:56,924 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
2021-03-16 20:38:56,924 INFO mapreduce.ImportJobBase: Retrieved 0 records.
2021-03-16 20:38:56,924 ERROR tool.ImportTool: Import failed: Import job failed!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题