When I run the following command for MAP Side Join. I get the following error. I have uploaded the file to hdfs. Please help



0
[cloudera@localhost hadoop]$ hadoop jar /home/cloudera/class4/mapsidejoin.jar com.eng.cache.MyDC /user/cloudera/class4/inputdata/distcache_demo/  /user/cloudera/class4/output/distributedcache/
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.mapreduce.Job.addCacheFile(Ljava/net/URI;)V
	at com.eng.cache.MyDC.main(MyDC.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:208)

 


4 Answer(s)


0

Hi Abhishek,

It is clearing says, it is not able to find the method

addCacheFile()

Please make sure, you have imported the JAR/lib who has method definition.

Hope this helps.

Thanks.


0

Hi Abhijit,

I am also facing the same issue even after importing the correct jar file and library:

I have imported the below jar files in my project:

commons-codec-1.4.jar
hadoop-common-2.2.0.jar
hadoop-mapreduce-client-core-2.2.0.jar

and imported the library in my code as below:

import org.apache.hadoop.mapreduce.Job;

While compiling the code in Eclipse there is no error. Only while executing the code I am geting error. I am using Cloudera Quickstart VM - 4.4.0.1. 

Can you please help here.

I am attaching the Java Project for your reference.

Thanks,

Soumyajit.

 

 



0

Hi Soumyajit ,

Could you please post the complete error.


0

Hi Abhijit,

 

Error below:

[cloudera@localhost MapJoin]$ hadoop jar /home/cloudera/MapredPractice/MapJoin/MapSideJoin.jar com.mr.mapjoin.MrJoinDriver /user/cloudera/Mapreduce/Mapjoin/input /user/cloudera/Mapreduce/Mapjoin/output
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.mapreduce.Job.addCacheFile(Ljava/net/URI;)V
    at com.mr.mapjoin.MrJoinDriver.main(MrJoinDriver.java:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:208)