sqoop执行job报错(org/json/JSONObject)
NoClassDefFoundError: org/json/JSONObject:
[root@hadoop2 ~]# sqoop job --create myjob7 -- import --connect jdbc:mysql://192.168.122.15:3306/company --username hivee --password-file file:///root/a.txt --table erp_admin_article --target-dir '/work/test12'--hive-import --hive-table erp_admin_article --fields-terminated-by ',' -m 1
注:import与"--"之间必须要有一个空格:
报错:
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)
......原因:sqoop缺少java-json.jar包.
解决:
这是因为sqoop缺少java-json.jar包.
下载java-json.jar包:
http://www.java2s.com/Code/Jar/j/Downloadjavajsonjar.htm
把java-json.jar添加到../sqoop/lib目录:
cp java-json.jar /sqoop/lib
Error executing statement: java.sql.SQLException: Access denied for user 'hivee'@'hadoop2
18/11/22 14:35:46 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Access denied for user 'hivee'@'hadoop2' (using password: YES)
java.sql.SQLException: Access denied for user 'hivee'@'hadoop2' (using password: YES)
18/11/22 14:35:46 ERROR tool.ImportTool: Import failed: java.io.IOException: No columns to generate for ClassWriter这是由于password文件格式不对的原因导致:
正确写入方式:
echo -n "123456" > sqoop.pwd
使用--password参数将有警告,并且需要输入密码才能执行Job,所以建议用密码文件形式
注意:使用密码文件有俩种使用方式
1>: --password-file file:///root/a.txt #这种方式是使用服务器上的文件
2>: --password-file /input/a.txt #这种方式是使用HDFS上的文件
sqoop执行job报错(org/json/JSONObject)的更多相关文章
- 执行mysqld_safe报错:mysqld does not exist or is not executable
执行mysqld_safe报错: [root@edu data]# /usr/local/mysql5.7/bin/mysqld_safe --user=mysql160427 12:41:28 my ...
- 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql
准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...
- selenium执行js报错
selenium执行js报错 Traceback (most recent call last): dr.execute_script(js) File "C:\Python27\l ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- 转 sqlplus执行sql报错:ORA-01756:
1.sqlplus执行sql报错:ORA-01756: quoted string not properly terminated 分类: 技术 在SQLPLUS中执行SQL文件时 ...
- js执行函数报错Cannot set property 'value' of null怎么解决?
js执行函数报错Cannot set property 'value' of null 的解决方案: 原因:dom还没有完全加载 第一步:所以js建议放在body下面执行, 第二步:window.on ...
- dotnetcore ef 调用多个数据库时用户命令执行操作报错
dotnetcore ef 调用多个数据库时用户命令执行操作报错 1.多个DbContext 时报错: 报错: More than one DbContext was found. Specify w ...
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- 【Selenium】【BugList4】执行pip报错:Fatal error in launcher: Unable to create process using '""D:\Program Files\Python36\python.exe"" "D:\Program Files\Python36\Scripts\pip.exe" '
环境信息: python版本:V3.6.4 安装路径:D:\Program Files\python36 环境变量PATH:D:\Program Files\Python36;D:\Program F ...
随机推荐
- Bash:生成随机文件内容
有的时候为了做些读写测试需要一些指定大小的文件,这时候可以通过下面的方法得到 dd if=/dev/urandom of=rnd_tmp_file bs=1M count=100 使用dd工具以Lin ...
- FIO测试磁盘的iops
FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...
- Github的readme.md的排版
排版格式: 1 标题与文字格式 标题 # 这是 H1 <一级标题> ## 这是 H2 <二级标题> ###### 这是 H6 <六级标题> 文字格式 **这是文字粗 ...
- LeetCode 536----Construct Binary Tree from String
536. Construct Binary Tree from String You need to construct a binary tree from a string consisting ...
- linux系统下安装ssl证书(tomcat)
1.申请ssl证书 2.下载ssl证书 打开此网址 https://myssl.com/cert_convert.html 将证书文件(xxx.com.crt)和密钥文件上传(xxx.com.key ...
- maven windows环境nexus3.0私服搭建
下载 nexus3.x.x 需要JDK1.8版本到sonatype官网下载开源免费的OSS版本,OSS即为Open Source Software.下载地址:https://www.sonatype. ...
- frame shiro 认证示例及原理简述
shiro 认证流程 1.创建一个 javaSE 的maven项目(quickstart),并添加依赖 <dependency> <groupId>junit</grou ...
- 带你从零学ReactNative开发跨平台App开发(六)
ReactNative跨平台开发系列教程: 带你从零学ReactNative开发跨平台App开发(一) 带你从零学ReactNative开发跨平台App开发(二) 带你从零学ReactNative开发 ...
- SCLAlertView-Swift
SCLAlertView-Swift https://github.com/vikmeup/SCLAlertView-Swift Animated Alert View written in Sw ...
- 【matlab】 拉格朗日插值
第一个函数 "lagrange1.m" 输入:X Y 与点x0 输出:插值函数对应函数值 y0 function y = lagrange1(X,Y,x0) n = length ...