You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Amandeep Khurana <am...@gmail.com> on 2009/06/27 01:43:04 UTC
Hadoop0.20 - Class Not Found exception
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...
Amandeep
Amandeep Khurana
Computer Science Graduate Student
University of California, Santa Cruz
Re: Hadoop0.20 - Class Not Found exception
Posted by imcaptor <im...@gmail.com>.
I meet the question also, resolved by transfer a class name to JobConf
constructor.
If you new the
*JobConf,you must transfer a class name to it.*
2009/6/27 Amandeep Khurana <am...@gmail.com>
> 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...
>
> Amandeep
>
>
> Amandeep Khurana
> Computer Science Graduate Student
> University of California, Santa Cruz
>
Re: Hadoop0.20 - Class Not Found exception
Posted by Steve Loughran <st...@apache.org>.
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