Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8509863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:32:58+00:00 2026-06-11T03:32:58+00:00

Solution: Use a better tutorial- http://hadoop.apache.org/mapreduce/docs/r0.22.0/mapred_tutorial.html I just started working with MapReduce, and I’m

  • 0

Solution: Use a better tutorial- http://hadoop.apache.org/mapreduce/docs/r0.22.0/mapred_tutorial.html

I just started working with MapReduce, and I’m running into a weird bug that I haven’t been able to answer through Google. I’m making a basic WordCount program, but when I run it, I get the following error during Reduce:

java.lang.RuntimeException: java.lang.NoSuchMethodException: org.apache.hadoop.mapred.Reducer.<init>()
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:485)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:420)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.mapred.Child.main(Child.java:249)

The WordCount program is the one from the Apache MapReduce tutorial. I’m running Hadoop 1.0.3 in pseudo-distributed mode on Mountain Lion, all of which I think is working fine since the examples are all executing normally. Any ideas?

EDIT: Here’s my code for reference:

package mrt;

import java.io.IOException;
import java.util.*;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapred.*;
import org.apache.hadoop.util.*;

public class WordCount {
public static class Map extends MapReduceBase implements Mapper<LongWritable, Text, Text, IntWritable> {

    private final static IntWritable one = new IntWritable(1);
    private Text word = new Text();

    public void map(LongWritable key, Text value, OutputCollector<Text,IntWritable> output, Reporter reporter)
      throws IOException{

        String line = value.toString();
        StringTokenizer tokenizer = new StringTokenizer(line);
        while(tokenizer.hasMoreTokens()){
            word.set(tokenizer.nextToken());
            output.collect(word,one);
        }
    }
}

public static class Reduce extends MapReduceBase implements Reducer<Text, IntWritable, Text, IntWritable> {

    public void reduce(Text key, Iterator<IntWritable> values, OutputCollector<Text, IntWritable> output, Reporter reporter)
      throws IOException{

        int sum = 0;

        while(values.hasNext()){
            sum += values.next().get();
        }

        output.collect(key, new IntWritable(sum));

    }
}

public static void main(String[] args) throws Exception{

    JobConf conf = new JobConf(WordCount.class);
    conf.setJobName("Wordcount");

    conf.setOutputKeyClass(Text.class);
    conf.setOutputValueClass(IntWritable.class);

    conf.setMapperClass(Map.class);
    conf.setCombinerClass(Reduce.class);
    conf.setReducerClass(Reducer.class);

    conf.setInputFormat(TextInputFormat.class);
    conf.setOutputFormat(TextOutputFormat.class);

    FileInputFormat.setInputPaths(conf, new Path(args[0]));
    FileOutputFormat.setOutputPath(conf, new Path(args[1]));

    JobClient.runJob(conf);

}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:32:59+00:00Added an answer on June 11, 2026 at 3:32 am

    The problem is not your choice of API. Both the stable (mapred.*) and the evolving (mapreduce.*) APIs are fully supported and the framework itself carries tests for both to ensure no regressions/breakage across releases.

    The problem is this line:

    conf.setReducerClass(Reducer.class);
    

    You’re setting the Reducer interface there as the Reducer, when you should be setting your implementation of the Reducer interface instead. Changing it to:

    conf.setReducerClass(Reduce.class);
    

    Will fix it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Everyone, every blog is talking about HTML 5 and giving solution to use HTML
best solution for use access in project for database with security i need to
How can we use Solution Package (WSP) MOSS 2007 to synchronize lists from one
I added the solution from use base64 image with Carrierwave in an effort to
I am looking for a good role based authorization solution to use alongside Authlogic.
I recently converted a multi-project Visual Studio solution to use .dlls instead of .libs
Hi I am trying to use the solution from Find all pattern indexes in
I am trying to use the solution given here -> C# ADO.NET: nulls and
if your app use this solution , do do you plan port the app
I am looking for a solution for user use the browser's back button to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.