解决Sqoop报错Could not load db driver class: com.intersys.jdbc.CacheDriver

Posted 凿石刻字

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决Sqoop报错Could not load db driver class: com.intersys.jdbc.CacheDriver相关的知识,希望对你有一定的参考价值。

报错栈:

17/06/16 17:46:01 INFO tool.CodeGenTool: Beginning code generation
17/06/16 17:46:01 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.intersys.jdbc.CacheDriver
java.lang.RuntimeException: Could not load db driver class: com.intersys.jdbc.CacheDriver
        at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:856)
        at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767)
        at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234)
        at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304)
        at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1870)
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1682)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

原因:执行导入的MR任务时找不到数据库连接的驱动包,只需把CacheDB.jar放到$SQOOP_HOME/lib下即可,sqoop提交MR任务时会自动把这个目录下的所有Jar包放入MR Job的Classpath中

以上是关于解决Sqoop报错Could not load db driver class: com.intersys.jdbc.CacheDriver的主要内容,如果未能解决你的问题,请参考以下文章

关于Could not load driverClass ${jdbc.driverClassName}问题解决方案

关于Could not load driverClass ${jdbc.driverClassName}问题解决方案

Svn启动窗口报错 Could not load file or assembly 'SharpSvn.dll' or one of its

解决TensorFlow-GPU 2.x使用GPU报错:Could not load dynamic library ‘libcudnn.so.7‘

Ubuntu 22.04 解决 使用 Qt报错:qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in ““ even...

PL/SQL developer 连接oracle数据库报错“initialization error could not load oci.dll”