title: java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.addDeprecation(Ljava/lang/String;[Ljava/lang/String;)
body: <p>I am using Java/Eclipse/Hadoop 2.2.0 (with all necessary jars) to run a sample Map Reduce task (Single Node locally) on Ubuntu using the below code but encountering exceptions (stacktrace below).</p>
  
  <p>I can run the sample word count example in Hadoop from the ubuntu console.</p>
  
  <h2>Code:</h2>
  
  <pre><code>import java.io.IOException;
  import java.util.StringTokenizer;
  import org.apache.hadoop.conf.Configuration;
  import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.Text;
  import org.apache.hadoop.mapreduce.Job;
  import org.apache.hadoop.mapreduce.Mapper;
  import org.apache.hadoop.mapreduce.Reducer;
  import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
  import org.apache.hadoop.mapreduce.lib.input.KeyValueTextInputFormat;
  import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
  
  public class testhdfs
  {
      public static class WordMapper extends Mapper&lt;Text, Text, Text, Text&gt;
      {
          private Text word = new Text();
          public void map(Text key, Text value, Context context) throws IOException, InterruptedException
          {
              StringTokenizer itr = new StringTokenizer(value.toString(),",");
              while (itr.hasMoreTokens())
              {
                  word.set(itr.nextToken());
                  context.write(key, word);
              }
          }
      }
      public static class AllTranslationsReducer
      extends Reducer&lt;Text,Text,Text,Text&gt;
      {
          private Text result = new Text();
          public void reduce(Text key, Iterable&lt;Text&gt; values,
          Context context
          ) throws IOException, InterruptedException
          {
              String translations = "";
              for (Text val : values)
              {
                  translations += "|"+val.toString();
              }
              result.set(translations);
              context.write(key, result);
          }
      }
      public static void main(String[] args) throws Exception
      {
          Configuration conf = new Configuration();
          Job job = new Job(conf, "dictionary");
          job.setJarByClass(testhdfs.class);
          job.setMapperClass(WordMapper.class);
          job.setReducerClass(AllTranslationsReducer.class);
          job.setOutputKeyClass(Text.class);
          job.setOutputValueClass(Text.class);
          job.setInputFormatClass(KeyValueTextInputFormat.class);
          FileInputFormat.addInputPath(job, new Path("/testext"));
          FileOutputFormat.setOutputPath(job, new Path("resulthdfs"));
          System.exit(job.waitForCompletion(true) ? 0 : 1);
      }
  }
  </code></pre>
  
  <h2>Stacktrace:</h2>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.addDeprecation(Ljava/lang/String;[Ljava/lang/String;)V
      at org.apache.hadoop.mapreduce.util.ConfigUtil.addDeprecatedKeys(ConfigUtil.java:53)
      at org.apache.hadoop.mapreduce.util.ConfigUtil.loadResources(ConfigUtil.java:41)
      at org.apache.hadoop.mapreduce.Job.&lt;clinit&gt;(Job.java:108)
      at testhdfs.main(testhdfs.java:49)
  </code></pre>