# \[ElasticSearch Hadoop\] Error in configuring object

**URL:** <https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968>\
**Category:** Elasticsearch\
**Created:** [June 6, 2014, 9:52pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968 "2014-06-06T21:52:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bharath\_bhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharath_bhat/32/1508_2.png) [@bharath\_bhat](https://discuss.elastic.co/u/bharath_bhat)\
**Post date:** [June 6, 2014, 9:52pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968/1 "2014-06-06T21:52:46Z")

</div>

Hi,

I'm trying to get a simple mapreduce job working with ES hadoop. I followed  
the docs to set up a job but I keep getting 'Error in configuring object'  
when I try to run it on Hadoop in pseudo distributed mode. I am using the  
old API with Hadoop 2.4.0.

Here's my code I am using:

public class SomeMapper extends MapReduceBase implements Mapper\<Object,  
Object, Text, MapWritable\> {

```
    // Dummy
    public void map(Object key, Object value, OutputCollector<Text, 

```

MapWritable\> output, Reporter reporter)  
throws IOException {  
Text docId = (Text) key;  
MapWritable doc = (MapWritable) value;  
output.collect(docId, doc);  
}  
}

```
public class SomeReducer extends MapReduceBase implements Reducer<Text, 

```

MapWritable, Text, MapWritable\> {

```
    // Dummy
    public void reduce(Text key, Iterator<MapWritable> values, 

```

OutputCollector\<Text, MapWritable\> output, Reporter reporter)  
throws IOException {  
Text docId = (Text) key;  
while (values.hasNext()){  
MapWritable out = (MapWritable)(values.next());  
output.collect(docId, out);  
}  
}  
}

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

    JobConf conf = new JobConf();
    conf.setJobName("elastic search hello world");
    conf.setSpeculativeExecution(false);

    conf.set("es.nodes", "localhost:9200");
    conf.set("es.resource", "answers_development/answer");
    conf.set("es.resource.read", "answers_development/answer");
    conf.set("es.resource.write", 

```

"questions\_development\_20140603205720870/question");  
conf.set("es.query", "{}");

```
    conf.setOutputFormat(EsOutputFormat.class);
    conf.setInputFormat(EsInputFormat.class);

    conf.setMapOutputKeyClass(Text.class);
    conf.setMapOutputValueClass(MapWritable.class);

    conf.setMapperClass(SomeMapper.class);
    conf.setReducerClass(SomeReducer.class);

    JobClient.runJob(conf);

};

```

Here's the relevant portion of the stack trace:

14/06/06 21:35:27 INFO mapred.MapTask: Map output collector class =  
org.apache.hadoop.mapred.MapTask$MapOutputBuffer  
14/06/06 21:35:28 INFO mapred.LocalJobRunner: map task executor complete.  
14/06/06 21:35:28 WARN mapred.LocalJobRunner: job\_local141518769\_0001  
java.lang.Exception: java.lang.RuntimeException: Error in configuring object  
at  
org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)  
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)  
Caused by: java.lang.RuntimeException: Error in configuring object  
at  
org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)  
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)  
at  
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)  
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)  
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)  
at  
org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)  
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)  
at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:744)  
Caused by: java.lang.reflect.InvocationTargetException  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:606)  
at  
org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)  
... 10 more  
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
at  
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
... 15 more  
Caused by: java.lang.NoSuchMethodException:  
com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
at java.lang.Class.getConstructor0(Class.java:2810)  
at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
at  
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)  
... 16 more  
14/06/06 21:35:28 INFO mapreduce.Job: Job job\_local141518769\_0001 failed  
with state FAILED due to: NA  
14/06/06 21:35:28 INFO mapreduce.Job: Counters: 0  
Exception in thread "main" java.io.IOException: Job failed!  
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:836)  
at com.edcast.cards.MapReduceHelloWorld.main(MapReduceHelloWorld.java:79)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:606)  
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am able to run Hadoop MR example jars, so I'm guessing there's something  
wrong with the ES integration. I'm new to ES Hadoop, apologies if I've  
missed something basic. Any help would be great. Thanks!

Bharath

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [June 6, 2014, 10:00pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968/2 "2014-06-06T22:00:04Z")

</div>

"  
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
at  
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
... 15 more  
Caused by: java.lang.NoSuchMethodException:  
com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
at java.lang.Class.getConstructor0(Class.java:2810)  
at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
at  
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)"

In other words, your Mapper has no default constructor defined for it. That  
is Hadoop cannot instantiate your mapper since your class definition is  
incorrect.

On Sat, Jun 7, 2014 at 12:52 AM, bharath bhat [bharathpbhat@gmail.com](mailto:bharathpbhat@gmail.com)  
wrote:

> Hi,
> 
> I'm trying to get a simple mapreduce job working with ES hadoop. I  
> followed the docs to set up a job but I keep getting 'Error in configuring  
> object' when I try to run it on Hadoop in pseudo distributed mode. I am  
> using the old API with Hadoop 2.4.0.
> 
> Here's my code I am using:
> 
> public class SomeMapper extends MapReduceBase implements Mapper\<Object,  
> Object, Text, MapWritable\> {
> 
> ```
> // Dummy
> public void map(Object key, Object value, OutputCollector<Text,
> 
> ```
> 
> MapWritable\> output, Reporter reporter)  
> throws IOException {  
> Text docId = (Text) key;  
> MapWritable doc = (MapWritable) value;  
> output.collect(docId, doc);  
> }  
> }
> 
> ```
> public class SomeReducer extends MapReduceBase implements
> 
> ```
> 
> Reducer\<Text, MapWritable, Text, MapWritable\> {
> 
> ```
> // Dummy
> public void reduce(Text key, Iterator<MapWritable> values,
> 
> ```
> 
> OutputCollector\<Text, MapWritable\> output, Reporter reporter)  
> throws IOException {  
> Text docId = (Text) key;  
> while (values.hasNext()){  
> MapWritable out = (MapWritable)(values.next());  
> output.collect(docId, out);  
> }  
> }  
> }
> 
> ```
> public static void main(String[] args) throws Exception {
> 
> JobConf conf = new JobConf();
> conf.setJobName("elastic search hello world");
> conf.setSpeculativeExecution(false);
> 
> conf.set("es.nodes", "localhost:9200");
> conf.set("es.resource", "answers_development/answer");
> conf.set("es.resource.read", "answers_development/answer");
> conf.set("es.resource.write",
> 
> ```
> 
> "questions\_development\_20140603205720870/question");  
> conf.set("es.query", "{}");
> 
> ```
> conf.setOutputFormat(EsOutputFormat.class);
> conf.setInputFormat(EsInputFormat.class);
> 
> conf.setMapOutputKeyClass(Text.class);
> conf.setMapOutputValueClass(MapWritable.class);
> 
> conf.setMapperClass(SomeMapper.class);
> conf.setReducerClass(SomeReducer.class);
> 
> JobClient.runJob(conf);
> 
> };
> 
> ```
> 
> Here's the relevant portion of the stack trace:
> 
> 14/06/06 21:35:27 INFO mapred.MapTask: Map output collector class =  
> org.apache.hadoop.mapred.MapTask$MapOutputBuffer  
> 14/06/06 21:35:28 INFO mapred.LocalJobRunner: map task executor complete.  
> 14/06/06 21:35:28 WARN mapred.LocalJobRunner: job\_local141518769\_0001  
> java.lang.Exception: java.lang.RuntimeException: Error in configuring  
> object  
> at  
> org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)  
> at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)  
> Caused by: java.lang.RuntimeException: Error in configuring object  
> at  
> org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)  
> at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)  
> at  
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)  
> at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)  
> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)  
> at  
> org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)  
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)  
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:744)  
> Caused by: java.lang.reflect.InvocationTargetException  
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> at java.lang.reflect.Method.invoke(Method.java:606)  
> at  
> org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)  
> ... 10 more  
> Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
> com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> at  
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
> at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
> ... 15 more  
> Caused by: java.lang.NoSuchMethodException:  
> com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> at java.lang.Class.getConstructor0(Class.java:2810)  
> at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
> at  
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)  
> ... 16 more  
> 14/06/06 21:35:28 INFO mapreduce.Job: Job job\_local141518769\_0001 failed  
> with state FAILED due to: NA  
> 14/06/06 21:35:28 INFO mapreduce.Job: Counters: 0  
> Exception in thread "main" java.io.IOException: Job failed!  
> at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:836)  
> at com.edcast.cards.MapReduceHelloWorld.main(MapReduceHelloWorld.java:79)  
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> at java.lang.reflect.Method.invoke(Method.java:606)  
> at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
> 
> I am able to run Hadoop MR example jars, so I'm guessing there's something  
> wrong with the ES integration. I'm new to ES Hadoop, apologies if I've  
> missed something basic. Any help would be great. Thanks!
> 
> Bharath
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAJogdmenKY1ihqv1SkJq4bfYQP1K1xExHTjaojd%2BdRR9tnY5rw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJogdmenKY1ihqv1SkJq4bfYQP1K1xExHTjaojd%2BdRR9tnY5rw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [June 6, 2014, 10:12pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968/3 "2014-06-06T22:12:30Z")

</div>

By the way, quickly looking at your class, it's likely because your  
mapper/reducer are defined at inner classes yet they are not static and  
thus cannot be used without their enclosing class. In other words, declare  
them as 'static'.

On Sat, Jun 7, 2014 at 1:00 AM, Costin Leau [costin.leau@gmail.com](mailto:costin.leau@gmail.com) wrote:

> "  
> Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
> com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> at  
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
> at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
> ... 15 more  
> Caused by: java.lang.NoSuchMethodException:  
> com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> at java.lang.Class.getConstructor0(Class.java:2810)  
> at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
> at  
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)"
> 
> In other words, your Mapper has no default constructor defined for it.  
> That is Hadoop cannot instantiate your mapper since your class definition  
> is incorrect.
> 
> On Sat, Jun 7, 2014 at 12:52 AM, bharath bhat [bharathpbhat@gmail.com](mailto:bharathpbhat@gmail.com)  
> wrote:
> 
> > Hi,
> > 
> > I'm trying to get a simple mapreduce job working with ES hadoop. I  
> > followed the docs to set up a job but I keep getting 'Error in configuring  
> > object' when I try to run it on Hadoop in pseudo distributed mode. I am  
> > using the old API with Hadoop 2.4.0.
> > 
> > Here's my code I am using:
> > 
> > public class SomeMapper extends MapReduceBase implements Mapper\<Object,  
> > Object, Text, MapWritable\> {
> > 
> > ```
> > // Dummy
> > public void map(Object key, Object value, OutputCollector<Text,
> > 
> > ```
> > 
> > MapWritable\> output, Reporter reporter)  
> > throws IOException {  
> > Text docId = (Text) key;  
> > MapWritable doc = (MapWritable) value;  
> > output.collect(docId, doc);  
> > }  
> > }
> > 
> > ```
> > public class SomeReducer extends MapReduceBase implements
> > 
> > ```
> > 
> > Reducer\<Text, MapWritable, Text, MapWritable\> {
> > 
> > ```
> > // Dummy
> > public void reduce(Text key, Iterator<MapWritable> values,
> > 
> > ```
> > 
> > OutputCollector\<Text, MapWritable\> output, Reporter reporter)  
> > throws IOException {  
> > Text docId = (Text) key;  
> > while (values.hasNext()){  
> > MapWritable out = (MapWritable)(values.next());  
> > output.collect(docId, out);  
> > }  
> > }  
> > }
> > 
> > ```
> > public static void main(String[] args) throws Exception {
> > 
> > JobConf conf = new JobConf();
> > conf.setJobName("elastic search hello world");
> > conf.setSpeculativeExecution(false);
> > 
> > conf.set("es.nodes", "localhost:9200");
> > conf.set("es.resource", "answers_development/answer");
> > conf.set("es.resource.read", "answers_development/answer");
> > conf.set("es.resource.write",
> > 
> > ```
> > 
> > "questions\_development\_20140603205720870/question");  
> > conf.set("es.query", "{}");
> > 
> > ```
> > conf.setOutputFormat(EsOutputFormat.class);
> > conf.setInputFormat(EsInputFormat.class);
> > 
> > conf.setMapOutputKeyClass(Text.class);
> > conf.setMapOutputValueClass(MapWritable.class);
> > 
> > conf.setMapperClass(SomeMapper.class);
> > conf.setReducerClass(SomeReducer.class);
> > 
> > JobClient.runJob(conf);
> > 
> > };
> > 
> > ```
> > 
> > Here's the relevant portion of the stack trace:
> > 
> > 14/06/06 21:35:27 INFO mapred.MapTask: Map output collector class =  
> > org.apache.hadoop.mapred.MapTask$MapOutputBuffer  
> > 14/06/06 21:35:28 INFO mapred.LocalJobRunner: map task executor complete.  
> > 14/06/06 21:35:28 WARN mapred.LocalJobRunner: job\_local141518769\_0001  
> > java.lang.Exception: java.lang.RuntimeException: Error in configuring  
> > object  
> > at  
> > org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)  
> > at  
> > org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)  
> > Caused by: java.lang.RuntimeException: Error in configuring object  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)  
> > at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)  
> > at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)  
> > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)  
> > at  
> > org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)  
> > at  
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)  
> > at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> > at java.lang.Thread.run(Thread.java:744)  
> > Caused by: java.lang.reflect.InvocationTargetException  
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > at  
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> > at  
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> > at java.lang.reflect.Method.invoke(Method.java:606)  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)  
> > ... 10 more  
> > Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
> > com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
> > at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
> > ... 15 more  
> > Caused by: java.lang.NoSuchMethodException:  
> > com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> > at java.lang.Class.getConstructor0(Class.java:2810)  
> > at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)  
> > ... 16 more  
> > 14/06/06 21:35:28 INFO mapreduce.Job: Job job\_local141518769\_0001 failed  
> > with state FAILED due to: NA  
> > 14/06/06 21:35:28 INFO mapreduce.Job: Counters: 0  
> > Exception in thread "main" java.io.IOException: Job failed!  
> > at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:836)  
> > at  
> > com.edcast.cards.MapReduceHelloWorld.main(MapReduceHelloWorld.java:79)  
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > at  
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> > at  
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> > at java.lang.reflect.Method.invoke(Method.java:606)  
> > at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
> > 
> > I am able to run Hadoop MR example jars, so I'm guessing there's  
> > something wrong with the ES integration. I'm new to ES Hadoop, apologies if  
> > I've missed something basic. Any help would be great. Thanks!
> > 
> > Bharath
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAJogdmfJ%2BGYn-\_snL3Mus2%3DwGWyP-mB4MZ8nPGufZ84sAq%3Dr7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJogdmfJ%2BGYn-_snL3Mus2%3DwGWyP-mB4MZ8nPGufZ84sAq%3Dr7Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![bharath\_bhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharath_bhat/32/1508_2.png) [@bharath\_bhat](https://discuss.elastic.co/u/bharath_bhat)\
**Post date:** [June 6, 2014, 10:38pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968/4 "2014-06-06T22:38:03Z")

</div>

That was it! Thank you.

On Friday, June 6, 2014 3:12:39 PM UTC-7, Costin Leau wrote:

> By the way, quickly looking at your class, it's likely because your  
> mapper/reducer are defined at inner classes yet they are not static and  
> thus cannot be used without their enclosing class. In other words, declare  
> them as 'static'.
> 
> On Sat, Jun 7, 2014 at 1:00 AM, Costin Leau \<[costi...@gmail.com](mailto:costi...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > "  
> > Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
> > com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
> > at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
> > ... 15 more  
> > Caused by: java.lang.NoSuchMethodException:  
> > com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> > at java.lang.Class.getConstructor0(Class.java:2810)  
> > at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
> > at  
> > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)"
> > 
> > In other words, your Mapper has no default constructor defined for it.  
> > That is Hadoop cannot instantiate your mapper since your class definition  
> > is incorrect.
> > 
> > On Sat, Jun 7, 2014 at 12:52 AM, bharath bhat \<[bharat...@gmail.com](mailto:bharat...@gmail.com)  
> > \<javascript:\>\> wrote:
> > 
> > > Hi,
> > > 
> > > I'm trying to get a simple mapreduce job working with ES hadoop. I  
> > > followed the docs to set up a job but I keep getting 'Error in configuring  
> > > object' when I try to run it on Hadoop in pseudo distributed mode. I am  
> > > using the old API with Hadoop 2.4.0.
> > > 
> > > Here's my code I am using:
> > > 
> > > public class SomeMapper extends MapReduceBase implements Mapper\<Object,  
> > > Object, Text, MapWritable\> {
> > > 
> > > ```
> > > // Dummy
> > > public void map(Object key, Object value, OutputCollector<Text, 
> > > 
> > > ```
> > > 
> > > MapWritable\> output, Reporter reporter)  
> > > throws IOException {  
> > > Text docId = (Text) key;  
> > > MapWritable doc = (MapWritable) value;  
> > > output.collect(docId, doc);  
> > > }  
> > > }
> > > 
> > > ```
> > > public class SomeReducer extends MapReduceBase implements 
> > > 
> > > ```
> > > 
> > > Reducer\<Text, MapWritable, Text, MapWritable\> {
> > > 
> > > ```
> > > // Dummy
> > > public void reduce(Text key, Iterator<MapWritable> values, 
> > > 
> > > ```
> > > 
> > > OutputCollector\<Text, MapWritable\> output, Reporter reporter)  
> > > throws IOException {  
> > > Text docId = (Text) key;  
> > > while (values.hasNext()){  
> > > MapWritable out = (MapWritable)(values.next());  
> > > output.collect(docId, out);  
> > > }  
> > > }  
> > > }
> > > 
> > > ```
> > > public static void main(String[] args) throws Exception {
> > > 
> > > JobConf conf = new JobConf();
> > > conf.setJobName("elastic search hello world");
> > > conf.setSpeculativeExecution(false);
> > > 
> > > conf.set("es.nodes", "localhost:9200");
> > > conf.set("es.resource", "answers_development/answer");
> > > conf.set("es.resource.read", "answers_development/answer");
> > > conf.set("es.resource.write", 
> > > 
> > > ```
> > > 
> > > "questions\_development\_20140603205720870/question");  
> > > conf.set("es.query", "{}");
> > > 
> > > ```
> > > conf.setOutputFormat(EsOutputFormat.class);
> > > conf.setInputFormat(EsInputFormat.class);
> > > 
> > > conf.setMapOutputKeyClass(Text.class);
> > > conf.setMapOutputValueClass(MapWritable.class);
> > > 
> > > conf.setMapperClass(SomeMapper.class);
> > > conf.setReducerClass(SomeReducer.class);
> > > 
> > > JobClient.runJob(conf);
> > > 
> > > };
> > > 
> > > ```
> > > 
> > > Here's the relevant portion of the stack trace:
> > > 
> > > 14/06/06 21:35:27 INFO mapred.MapTask: Map output collector class =  
> > > org.apache.hadoop.mapred.MapTask$MapOutputBuffer  
> > > 14/06/06 21:35:28 INFO mapred.LocalJobRunner: map task executor complete.  
> > > 14/06/06 21:35:28 WARN mapred.LocalJobRunner: job\_local141518769\_0001  
> > > java.lang.Exception: java.lang.RuntimeException: Error in configuring  
> > > object  
> > > at  
> > > org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)  
> > > at  
> > > org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)  
> > > Caused by: java.lang.RuntimeException: Error in configuring object  
> > > at  
> > > org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)  
> > > at  
> > > org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)  
> > > at  
> > > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)  
> > > at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)  
> > > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)  
> > > at  
> > > org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)  
> > > at  
> > > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)  
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> > > at  
> > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> > > at  
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> > > at java.lang.Thread.run(Thread.java:744)  
> > > Caused by: java.lang.reflect.InvocationTargetException  
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > > at  
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> > > at  
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> > > at java.lang.reflect.Method.invoke(Method.java:606)  
> > > at  
> > > org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)  
> > > ... 10 more  
> > > Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException:  
> > > com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> > > at  
> > > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)  
> > > at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)  
> > > ... 15 more  
> > > Caused by: java.lang.NoSuchMethodException:  
> > > com.edcast.cards.MapReduceHelloWorld$SomeMapper.()  
> > > at java.lang.Class.getConstructor0(Class.java:2810)  
> > > at java.lang.Class.getDeclaredConstructor(Class.java:2053)  
> > > at  
> > > org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)  
> > > ... 16 more  
> > > 14/06/06 21:35:28 INFO mapreduce.Job: Job job\_local141518769\_0001 failed  
> > > with state FAILED due to: NA  
> > > 14/06/06 21:35:28 INFO mapreduce.Job: Counters: 0  
> > > Exception in thread "main" java.io.IOException: Job failed!  
> > > at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:836)  
> > > at  
> > > com.edcast.cards.MapReduceHelloWorld.main(MapReduceHelloWorld.java:79)  
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > > at  
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> > > at  
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> > > at java.lang.reflect.Method.invoke(Method.java:606)  
> > > at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
> > > 
> > > I am able to run Hadoop MR example jars, so I'm guessing there's  
> > > something wrong with the ES integration. I'm new to ES Hadoop, apologies if  
> > > I've missed something basic. Any help would be great. Thanks!
> > > 
> > > Bharath
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b76494ce-20d0-496d-a500-181cd4b75537%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/78c31177-66d9-4133-aa3d-d06f66d19cc2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/78c31177-66d9-4133-aa3d-d06f66d19cc2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![punit\_naik](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@punit\_naik](https://discuss.elastic.co/u/punit_naik)\
**Post date:** [June 19, 2014, 8:12am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968/5 "2014-06-19T08:12:00Z")

</div>

Hello Bharat

I am also getting the same error but except the NoSuchMethodException.  
I have hit a bump in my project work and I just cannot proceed.  
Like you, I also have used JobConf and not Job to initialise my job object as Job doesn'st support DBOutputFormat class. My source files are also almost the same as yours.

Please help me.

Thank You.  
Punit

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:21am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-error-in-configuring-object/17968/6 "2017-07-06T01:21:18Z")

</div>


