Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject,是因为缺少java-json.jar

百度云链接:https://pan.baidu.com/s/1Zu8yos3mTzA2A17Pqycxkw

提取码:is4k

[root@Master sqoop-1.4.7.bin__hadoop-2.6.0]# bin/sqoop job --create job_pms_store -- import --connect jdbc:mysql://Master:3306/anxin_oa?useSSL=false --table pms_store   --username mysql_name -P  --hive-import  --hive-table  bigdata.pms_store  --hive-overwrite --fields-terminated-by '\t'

sqoop创建job任务输入密码之后出现

19/07/29 08:33:40 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password: 
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
        at org.apache.sqoop.util.SqoopJsonUtil.getJsonStringforMap(SqoopJsonUtil.java:43)
        at org.apache.sqoop.SqoopOptions.writeProperties(SqoopOptions.java:785)
        at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.createInternal(HsqldbJobStorage.java:399)
        at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.create(HsqldbJobStorage.java:379)
        at org.apache.sqoop.tool.JobTool.createJob(JobTool.java:181)
        at org.apache.sqoop.tool.JobTool.run(JobTool.java:294)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: org.json.JSONObject
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 12 more

是因为sqoop的lib目录下缺少java-json.jar,放进去

jar包网盘链接有!

从新创建sqoop job

19/07/29 08:57:37 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password: 
[root@Master sqoop-1.4.7.bin__hadoop-2.6.0]# 

[root@Master sqoop-1.4.7.bin__hadoop-2.6.0]# sqoop job --list

查看job列表

创建成功!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值