QnaList > Groups > Cdh-User > Feb 2013
faq

Package And Deploy 3rd Party Jars For CDH4 When Submitting Jobs Programmatically

I recently switched from CDH3 to CDH4, and now I'm getting ClassNotFoundExceptions for any 3rd party jars my Mappers or Reducers reference.  I currently use the maven assembly plugin to build a jar that packages all referenced jars inside the main jar's lib folder.  On CDH3, when a mapper or reducer was executed the Hadoop's JVM was able to find any referenced jars inside the lib folder and use them without any problem.  Do I need to update the class path setting in primary jar's manifest to point to the lib folder?  I didn't have to do this with CDH3.
On CDH4, the hadoop JVM doesn't seem to be able find/use any jars in the lib folder, hence the ClassNotFoundExceptions.  To temporarily get around this problem I've unpackaged the 3rd party jars, so all their .class files are loose in my main jar.  But I'm not a big fan of this approach.  
I have read multiple time that CDH4 changed how 3rd party jars are referenced and/or loaded, and the "preferred" method to reference and deploy them is by declaring them with the "-libjars" flag from the cmd line.  That works great when a person is manually kicking off a MR job from the cmd line, but not when MR jobs are built into a software product, which get invoked by the Hadoop Java API.  How are we supposed to handle 3rd party jars when the MR jobs are being initiated by an application server via the Java Hadoop API?
Thanks,
JohnC

asked Feb 27 2013 at 12:16

John Conwell's gravatar image



2 Replies for : Package And Deploy 3rd Party Jars For CDH4 When Submitting Jobs Programmatically
Hi John, 
Could you also add in if you use MR1 or MR2 in CDH4? 
- show quoted text -
> -- 
> 
> 
> 
-- 
Harsh J

answered Feb 27 2013 at 12:46

Harsh J's gravatar image


answered Feb 27 2013 at 13:48

John Conwell's gravatar image


Related discussions

Tagged

Group Cdh-user

asked Feb 27 2013 at 12:16

active Feb 27 2013 at 13:48

posts:3

users:2

Cdh-user

©2013 QnaList.com . QnaList is part of ZisaTechnologies LLC.