Hadoop's WordCount runs form command line but not from Eclipse
eclipse, hadoop, mapreduce
Solution
Add the following two lines in your job through your Configuration abject :
Configuration.addResource(new Path("path-to-your-core-site.xml file"));
Configuration.addResource(new Path("path-to-your-hdfs-site.xml file"));
Problem
In the last few days, I have tested multiple version of Hadoop (1.0.1, 1.0.2, 1.1.4). In each case, I can easily run the WordCount program using the following command line: ``` hadoop jar hadoop-examples-1.1.1.jar wordcount /input output ``` Since the above command executes successfuly, then I assume that my Hadoop configuration is correct. But I get the following error message for each single version when I try to run the program using exact same input from Eclipse. Can anyone give me the reason why it wouldn't run from Eclipse? ``` Dec 12, 2012 2:19:41 PM org.apache.hadoop.util.NativeCodeLoader <clinit> WARNING: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Dec 12, 2012 2:19:41 PM org.apache.hadoop.mapred.JobClient copyAndConfigureFiles WARNING: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String). ****file:/tmp/wordcount/in Dec 12, 2012 2:19:42 PM org.apache.hadoop.mapred.JobClient$2 run INFO: Cleaning up the staging area file:/tmp/hadoop-root/mapred/staging/root-41981592/.staging/job_local_0001 Dec 12, 2012 2:19:42 PM org.apache.hadoop.security.UserGroupInformation doAs SEVERE: PriviledgedActionException as:root cause:org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235) at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252) at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962) at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979) at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1093) at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850) at org.apache.hadoop.mapreduce.Job.submit(Job.java:500) at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530) at com.igalia.wordcount.WordCount.run(WordCount.java:94) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) at com.igalia.wordcount.App.main(App.java:28) ```