1. 程式人生 > >解決Sqoop報錯Could not load db driver class: com.intersys.jdbc.CacheDriver

解決Sqoop報錯Could not load db driver class: com.intersys.jdbc.CacheDriver

cti writer cman sql make time nec generate ava

報錯棧:

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