hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kim Chew <kchew...@gmail.com>
Subject Adding jars using DistributedCache API.
Date Wed, 05 Feb 2014 02:06:25 GMT
Hello there,

I know I can do it with "-libjars" but I want to play around with the
DCache API. First I copy my jar file to hdfs, therefore,


And my M/R program references a class (Say, Foo) in foo.jar. In my driver,
I use the DCache API,

      DistributedCache.addFileToClassPath(new Path("/user/kim/lib/foo.jar",
conf, fs);

But I get a CNFE when I run the M/R job

 14/02/04 17:52:48 INFO mapred.JobClient: Task Id :
attempt_201401071457_8950_m_000000_0, Status : FAILED
Error: java.lang.ClassNotFoundException: com.myproject.Foo
    at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:626)

I have tried "addArchiveToClassPath()" but still getting the CNFE.
Any pointers? Thanks.


View raw message