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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/23492ffa-818b-433e-9185-ef52e14e8068%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to