sqoop1.4.7链接mysql报错org.apache.commons.lang.StringUtils

[root@node7-3 sqoop1]# bin/sqoop list-databases --connect 'jdbc:mysql://192.168.56.1:3306/ ?useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true'  --username root --password 123456
Warning: /data/sqoop/sqoop1/bin/../../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /data/sqoop/sqoop1/bin/../../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
2021-03-09 19:37:46,394 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
2021-03-09 19:37:46,538 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
2021-03-09 19:37:46,629 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
    at org.apache.sqoop.manager.MySQLManager.initOptionDefaults(MySQLManager.java:73)
    at org.apache.sqoop.manager.SqlManager.<init>(SqlManager.java:89)
    at com.cloudera.sqoop.manager.SqlManager.<init>(SqlManager.java:33)
    at org.apache.sqoop.manager.GenericJdbcManager.<init>(GenericJdbcManager.java:51)
    at com.cloudera.sqoop.manager.GenericJdbcManager.<init>(GenericJdbcManager.java:30)
    at org.apache.sqoop.manager.CatalogQueryManager.<init>(CatalogQueryManager.java:46)
    at com.cloudera.sqoop.manager.CatalogQueryManager.<init>(CatalogQueryManager.java:31)
    at org.apache.sqoop.manager.InformationSchemaManager.<init>(InformationSchemaManager.java:38)
    at com.cloudera.sqoop.manager.InformationSchemaManager.<init>(InformationSchemaManager.java:31)
    at org.apache.sqoop.manager.MySQLManager.<init>(MySQLManager.java:65)
    at org.apache.sqoop.manager.DefaultManagerFactory.accept(DefaultManagerFactory.java:67)
    at org.apache.sqoop.ConnFactory.getManager(ConnFactory.java:184)
    at org.apache.sqoop.tool.BaseSqoopTool.init(BaseSqoopTool.java:272)
    at org.apache.sqoop.tool.ListDatabasesTool.run(ListDatabasesTool.java:44)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
    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.apache.commons.lang.StringUtils
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 20 more
[root@node7-3 sqoop1]# 

sqoop1.4.7的Commons-lang-3-3.4.jar不支持,本人下载了两个最终2.6版本的可以使用。下载地址:

http://mirrors.tuna.tsinghua.edu.cn/apache//commons/lang/binaries/commons-lang-2.6-bin.zip

 

 

 

 

posted @ 2021-03-09 20:52  shan_zhayidian  阅读(294)  评论(0编辑  收藏  举报