Today I was trying to run mapreduce wordcount code on my eclipse, I copied code from here http://wiki.apache.org/hadoop/WordCount
but with this I was getting following error,
java.lang.RuntimeException: java.lang.ClassNotFoundException: WordCount$Map
after bit of googling I found
add the commented line below
Job job = new Job(conf, "wordcount");
//job.setJarByClass(WordCount.class);
Now its working :)
I added it and still have this issue .... :\
ReplyDeleteThanks, this solved the problem.
ReplyDeleteThis comment has been removed by the author.
DeleteThanks.It worked for me.
ReplyDeletevoila...it works!!!. Not sure why there is no documentation on this in WC pgm.
ReplyDeleteThanks !
ReplyDeleteIt worked.
Thanks after a horrible sunday morning debuging the things finally it worked !!
ReplyDeletestill not working
ReplyDelete
ReplyDeleteJob job = new Job(conf, "wordcount");
job.setJarByClass(WordCount.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
Added the above snip and worked for me!
Thanks
Thanks for your post. For those who say does not work, do not forget to compile your java file again and build your jar again :)
ReplyDeleteeven i tried with job.setJarByClass(PdfInputDriver.class); method but it didn't worked
ReplyDeleteMyPdfProject.jar jar exported from eclipse,its working perfect in eclipse.
Error:-
java.lang.RuntimeException: java.lang.ClassNotFoundException: WordCountMapperr
terminal:-
export LIBJARS=/home/devendar/Desktop/pdf external jars/fontbox-1.3.1.jar,/home/devendar/Desktop/pdf external jars/pdfbox-1.2.0.jar;
export HADOOP_CLASSPATH=/home/devendar/Desktop/pdfexternaljars/fontbox-1.3.1.jar:/home/devendar/Desktop/pdfexternaljars/pdfbox-1.2.0.jar;
hadoop jar MyPdfProject.jar -libjars ${LIBJARS} /usr/data/Input/DCPD-201400050.pdf /usr/data/output/outppput
please help me in solving this issue