当我们尝试通过SQOOP连接到mysql时出现错误

问题描述 投票:0回答:1
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.URLClas`enter code here`sLoader.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)
    ... 20 more
mysql sqoop
1个回答
0
投票

问题出在这里

Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils

找不到StringUtils的类定义,这意味着您缺少一些jar文件。

编辑:

请遵循注释以下载jar文件并将其包含在环境中。

© www.soinside.com 2019 - 2024. All rights reserved.