Reputation: 349
I have made 3 files in java,made a jar file and wrote this line to execute the MapReduce code:
hadoop jar /home/xyz/Documents/hadoop-2.7.3/abc1.jar woq.WordCount /test/vocab.txt /test/output3
The jar filename is abc1.jar,woq is the package name and WordCount is the main class in which the job is defined for mapreduce code.When this line is executed,following error is displayed:
Exception in thread "main" java.lang.ClassNotFoundException: woq.WordCount
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Any suggestions on what I point am I missing in executing the above line?
Output of the grep command(in comments):
Sun Jan 22 21:04:20 IST 2017 WordCountMapper.class
Sun Jan 22 21:04:20 IST 2017 WordCountReducer.class
Sun Jan 22 21:04:20 IST 2017 WordCount.class
Upvotes: 1
Views: 165
Reputation: 18270
From the comments,
The class files appear to have the line package woq;
in them without the acutal directory structure. You can either create a parent directory woq
or remove that line from the files and recompile it.
If you remove the line, you can submit the job like this
hadoop jar /home/xyz/Documents/hadoop-2.7.3/abc1.jar WordCount /test/vocab.txt /test/output3
Upvotes: 2