Amandeep Khurana wrote:
I'm getting the following error while starting a MR job:
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
at
org.apache.hadoop.mapred.lib.db.DBInputFormat.configure(DBInputFormat.java:297)
... 21 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.apache.hadoop.mapred.lib.db.DBConfiguration.getConnection(DBConfiguration.java:123)
at
org.apache.hadoop.mapred.lib.db.DBInputFormat.configure(DBInputFormat.java:292)
... 21 more
Interestingly, the relevant jar is bundled into the MR job jar and its also
there in the $HADOOP_HOME/lib directory.
Exactly same thing worked with 0.19.. Not sure what could have changed or I
broke to cause this error...
could be classloader hierarchy; the JDBC driver needs to be at the right
level. Try preheating the driver by loading it in your own code, then
jdbc:URLs might work, and take it out of the MR Job JAR