Support Questions
Find answers, ask questions, and share your expertise

Oozie / Sqoop: Could not load db driver class

Highlighted

Oozie / Sqoop: Could not load db driver class

New Contributor

While adding a new MS SQL data source, I have run into issues loading the driver when using Oozie to execute a Sqoop workflow.

Using Sqoop CLI, I had the same problem at first, until I added the driver jar to /usr/hdp/2.3.4.0-3485/sqoop/lib (the current version) on the name node, as well as /user/oozie/share/lib/lib_20160122110131/sqoop/ (timestamp) and /user/oozie/share/lib/sqoop/ on HDFS. So, using Sqoop CLI I am able to connect.

However, using Oozie to execute a workflow, I get the error message "Could not load db driver class":

2016-08-17 14:15:43,293 DEBUG [main] sqoop.ConnFactory (ConnFactory.java:instantiateFactories(101)) - Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
4626 [main] DEBUG org.apache.sqoop.ConnFactory  - Trying ManagerFactory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
2016-08-17 14:15:43,293 DEBUG [main] sqoop.ConnFactory (ConnFactory.java:getManager(183)) - Trying ManagerFactory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
4681 [main] DEBUG org.apache.sqoop.manager.oracle.OraOopManagerFactory  - Data Connector for Oracle and Hadoop can be called by Sqoop!
2016-08-17 14:15:43,348 DEBUG [main] oracle.OraOopManagerFactory (OraOopLog.java:debug(42)) - Data Connector for Oracle and Hadoop can be called by Sqoop!
4681 [main] DEBUG org.apache.sqoop.ConnFactory  - Trying ManagerFactory: com.cloudera.sqoop.manager.DefaultManagerFactory
2016-08-17 14:15:43,348 DEBUG [main] sqoop.ConnFactory (ConnFactory.java:getManager(183)) - Trying ManagerFactory: com.cloudera.sqoop.manager.DefaultManagerFactory
4682 [main] DEBUG org.apache.sqoop.manager.DefaultManagerFactory  - Trying with scheme: jdbc:sqlserver:
2016-08-17 14:15:43,349 DEBUG [main] manager.DefaultManagerFactory (DefaultManagerFactory.java:accept(49)) - Trying with scheme: jdbc:sqlserver:
4694 [main] INFO  org.apache.sqoop.manager.SqlManager  - Using default fetchSize of 1000
2016-08-17 14:15:43,361 INFO  [main] manager.SqlManager (SqlManager.java:initOptionDefaults(98)) - Using default fetchSize of 1000
4694 [main] DEBUG org.apache.sqoop.ConnFactory  - Instantiated ConnManager org.apache.sqoop.manager.SQLServerManager@4fd1b34f
2016-08-17 14:15:43,361 DEBUG [main] sqoop.ConnFactory (ConnFactory.java:getManager(186)) - Instantiated ConnManager org.apache.sqoop.manager.SQLServerManager@4fd1b34f
4694 [main] INFO  org.apache.sqoop.tool.CodeGenTool  - Beginning code generation
2016-08-17 14:15:43,361 INFO  [main] tool.CodeGenTool (CodeGenTool.java:generateORM(92)) - Beginning code generation
4701 [main] DEBUG org.apache.sqoop.manager.SqlManager  - Execute getColumnInfoRawQuery : SELECT * FROM foo.bar WHERE dte_start BETWEEN '2016-08-16' AND '2016-08-17' AND  (1 = 0)
2016-08-17 14:15:43,368 DEBUG [main] manager.SqlManager (SqlManager.java:getColumnInfoForRawQuery(268)) - Execute getColumnInfoRawQuery : SELECT * FROM foo.bar WHERE dte_start BETWEEN '2016-08-16' AND '2016-08-17' AND  (1 = 0)
4704 [main] ERROR org.apache.sqoop.Sqoop  - Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
2016-08-17 14:15:43,371 ERROR [main] sqoop.Sqoop (Sqoop.java:runSqoop(186)) - Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
Intercepting System.exit(1)
3 REPLIES 3
Highlighted

Re: Oozie / Sqoop: Could not load db driver class

New Contributor

Thank you, @Jason Phelps. Of course, this was the solution -sharelibupdate did the trick

Highlighted

Re: Oozie / Sqoop: Could not load db driver class

Explorer

Whats the exact trick? could you please elaborate.

Re: Oozie / Sqoop: Could not load db driver class

Expert Contributor
He probably was referring to:  oozie admin -sharelibupdate