# Questioins about setting up eshadoop

**URL:** https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657
**Category:** Elasticsearch
**Created:** [September 17, 2013, 8:22pm UTC](https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657 "2013-09-17T20:22:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Wenfeng\_Xu](https://avatars.discourse-cdn.com/v4/letter/w/e68b1a/32.png) [@Wenfeng\_Xu](https://discuss.elastic.co/u/Wenfeng_Xu)
#### Post date: [September 17, 2013, 8:22pm UTC](https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657/1 "2013-09-17T20:22:58Z")

</div>

Hi all,

I am new to eshadoop and hadoop. I want to contribute to the eshadoop  
project but I am having trouble to run the code. I wrote a small piece of  
code and followed the step described somewhere online. I add external jar:  
elasticsearch-hadoop-1.3.0.BUILD-20130915.230651-143.jar to build path and  
export my code to runnable jar in eclipse. But when I run it with: hadoop  
jar wordcount, I got class not found exception for esinputformat and  
esoutputformat. There are no compiler errors for my code. Here is my code  
and the error:  
public static void main(String[] args) throws Exception {  
Configuration conf = new Configuration();  
conf.set("es.resource", "twitter/tweet/\_search?q=kimchy");  
Job job = new Job(conf, "word count");

```
job.setInputFormatClass(ESInputFormat.class);
job.setOutputFormatClass(ESOutputFormat.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(MapWritable.class);

System.exit(job.waitForCompletion(true) ? 0 : 1);

```

}

Task Id : attempt\_201309170214\_0001\_m\_000006\_0, Status : FAILED  
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.elasticsearch.hadoop.mr.ESOutputFormat  
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:857)

Could someone tell me what I did wrong? BTW, I know that a mapreduce  
program should have mapper and reducer. But the code(which is similar to  
someone's post) above doesn't have. Could someone explain it to me? Thank  
you very much!!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Himanshu\_Gautam](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@Himanshu\_Gautam](https://discuss.elastic.co/u/Himanshu_Gautam)
#### Post date: [May 6, 2014, 5:19am UTC](https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657/2 "2014-05-06T05:19:53Z")

</div>

I am getting similar error with :

ES : 1.1.1  
Hadoop: Hadoop 1.0.2  
JDK: 1.6.0\_24  
elasticsearch-hadoop-1.3.0.M3

/hadoopApps/wordcount$ hadoop jar WordCount.jar WordCount  
/user/himanshu/inputdir  
Exception in thread "main" java.lang.NoClassDefFoundError:  
org/elasticsearch/hadoop/mr/EsOutputFormat  
at WordCount.main(WordCount.java:72)  
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:616)  
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)  
Caused by: java.lang.ClassNotFoundException:  
org.elasticsearch.hadoop.mr.EsOutputFormat  
at java.net.UR

--  
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/339c408f-115f-4d27-ba81-079165a420bb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/339c408f-115f-4d27-ba81-079165a420bb%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: [May 6, 2014, 7:29am UTC](https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657/3 "2014-05-06T07:29:36Z")

</div>

The NCDFE is an indication that the es-hadoop jar is not included in your jar. I recommend reading the official  
documentation  
[1] which explains each integration in detail, including Map/Reduce.

[1] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/hadoop/current/reference.html)

P.S. Make sure you look at the configuration section as well since you are using the old format of "es.resource"

On 5/6/14 8:19 AM, Himanshu Gautam wrote:

> I am getting similar error with :
> 
> ES : 1.1.1
> 
> Hadoop: Hadoop 1.0.2  
> JDK: 1.6.0\_24  
> elasticsearch-hadoop-1.3.0.M3  
> /hadoopApps/wordcount$ hadoop jar WordCount.jar WordCount /user/himanshu/inputdir  
> Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/hadoop/mr/EsOutputFormat  
> at WordCount.main(WordCount.java:72)  
> 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:616)  
> at org.apache.hadoop.util.RunJar.main(RunJar.java:156)  
> Caused by: java.lang.ClassNotFoundException: org.elasticsearch.hadoop.mr.EsOutputFormat  
> at java.net.UR
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/339c408f-115f-4d27-ba81-079165a420bb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/339c408f-115f-4d27-ba81-079165a420bb%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/339c408f-115f-4d27-ba81-079165a420bb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/339c408f-115f-4d27-ba81-079165a420bb%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Costin

--  
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/53688F60.8040601%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/53688F60.8040601%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Jonas\_Grote](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jonas\_Grote](https://discuss.elastic.co/u/Jonas_Grote)
#### Post date: [July 29, 2014, 7:07am UTC](https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657/4 "2014-07-29T07:07:25Z")

</div>

When using the "new" Hadoop API, you need to provide the elasticsearch lib  
using the "-libjars" option when running "hadoop jar your.jar  
...MainClass". Somehow this first appeared for me after I switched from the  
old API to the new API.

Regards,

Jonas

Am Dienstag, 17. September 2013 22:22:58 UTC+2 schrieb Wenfeng Xu:

> Hi all,
> 
> I am new to eshadoop and hadoop. I want to contribute to the eshadoop  
> project but I am having trouble to run the code. I wrote a small piece of  
> code and followed the step described somewhere online. I add external jar:  
> elasticsearch-hadoop-1.3.0.BUILD-20130915.230651-143.jar to build path  
> and export my code to runnable jar in eclipse. But when I run it with:  
> hadoop jar wordcount, I got class not found exception for esinputformat and  
> esoutputformat. There are no compiler errors for my code. Here is my code  
> and the error:  
> public static void main(String args) throws Exception {  
> Configuration conf = new Configuration();  
> conf.set("es.resource", "twitter/tweet/\_search?q=kimchy");  
> Job job = new Job(conf, "word count");
> 
> ```
> job.setInputFormatClass(ESInputFormat.class);
> job.setOutputFormatClass(ESOutputFormat.class);
> job.setOutputKeyClass(Text.class);
> job.setOutputValueClass(MapWritable.class);
> 
> System.exit(job.waitForCompletion(true) ? 0 : 1);
> 
> ```
> 
> }
> 
> Task Id : attempt\_201309170214\_0001\_m\_000006\_0, Status : FAILED
> 
> java.lang.RuntimeException: java.lang.ClassNotFoundException: org.elasticsearch.hadoop.mr.ESOutputFormat  
> at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:857)
> 
> Could someone tell me what I did wrong? BTW, I know that a mapreduce  
> program should have mapper and reducer. But the code(which is similar to  
> someone's post) above doesn't have. Could someone explain it to me? Thank  
> you very much!!

--  
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/23492ffa-818b-433e-9185-ef52e14e8068%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/23492ffa-818b-433e-9185-ef52e14e8068%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:12am UTC](https://discuss.elastic.co/t/questioins-about-setting-up-eshadoop/13657/5 "2017-07-06T01:12:38Z")

</div>


