Hadoop: The Definitive Guide (3rd Ed) error with MaxTemperature example
In the book Hadoop: The Definitive Guide (3rd Ed), there is an error in Chapter 2 MapReduce (the error is also in the ePub and PDF versions). The book shows setting HADOOP_CLASSPATH=hadoop-examples.jar, however this JAR file does not exist. The Ant build.xml creates a job.jar file which contains all of the examples included in the book. Setting HADOOP_CLASSPATH=job.jar fixes this problem and allows the example to work properly.
The error you will get if you have the HADOOP_CLASSPATH set incorrectly (as specified in the book) will be:
# hadoop MaxTemperature input/ncdc/sample.txt output
Exception in thread "main" java.lang.NoClassDefFoundError: MaxTemperature
Caused by: java.lang.ClassNotFoundException: MaxTemperature
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: MaxTemperature. Program will exit.
I have submitted this correction to be included in the Errata and hopefully it will be reflected on the books website soon.
Recent Posts
See AllRecently I was working on a problem with Time Series. Time Series can quickly add up to a lot of data, as you are using previous...
One of the biggest bottlenecks in Deep Learning is loading data. having fast drives and access to the data is important, especially if...
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.TableName;...
Comments