Note that there are some explanatory texts on larger screens.

plurals
  1. POHadoop ToolRunner fails with NoClassDefFoundError
    primarykey
    data
    text
    <p>I have a created a simple MapReduce Driver that implements the Tool interface. But when I try to run the job in Eclipse, I get a <code>NoClassDefFoundError</code> before the <code>run()</code> method is invoked. </p> <p>I am running <code>Hadoop 0.20.2</code> on <code>Ubuntu 10.04 LTS</code>. The source code and stack trace are provided below. Any assistance will be greatly appreciated.</p> <h2>Sourcecode</h2> <pre><code>import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.*; public class MyTestDriver extends Configured implements Tool { @Override public int run(String[] args) throws Exception { if (args.length != 2) { System.err.printf("Usage: %s [generic options] &lt;input&gt; &lt;output&gt;\n", getClass().getSimpleName()); ToolRunner.printGenericCommandUsage(System.err); return -1; } // Code here to submit Hadoop Job ... return 0; } /** * @param args */ public static void main(String[] args) throws Exception { int exitCode = ToolRunner.run(new MyTestDriver(), args); System.exit(exitCode); } </code></pre> <p>}</p> <h2>Stacktrace</h2> <blockquote> <p>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:59) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79) at MaxTemperatureDriver.main(MaxTemperatureDriver.java:44) Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 3 more</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload