Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Oozie Hive Action Class Not Found Exception

Highlighted

Oozie Hive Action Class Not Found Exception

Contributor

Trying to run a basic oozie workflow that completes a hive action and i keep getting this error: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found

Here is the XML workflow:

<workflow-app xmlns = "uri:oozie:workflow:0.5" name = "test_workflow">

<start to = "test_query" />

<!--Step 1 --> <action name = "test_query">

<hive xmlns = "uri:oozie:hive-action:0.5">

<job-tracker>jobtracker</job-tracker>

<name-node>nameNode</name-node>

<configuration> <property> <name>oozie.use.system.libpath</name> <value>true</value> </property>

<property> <name>oozie.libpath</name> <value>nameNode/user/oozie/share/lib/lib_20161215134654</value> </property> </configuration>

<script>hdfspath/hive.hql</script>

</hive>

<ok to = "end" />

<error to = "kill_job" />

</action>

<kill name = "kill_job"> <message>Job Failed</message> </kill>

<end name = "end" />

</workflow-app>

5 REPLIES 5
Highlighted

Re: Oozie Hive Action Class Not Found Exception

Explorer

Can you please share the full stack trace?

Highlighted

Re: Oozie Hive Action Class Not Found Exception

Contributor

@tli

2017-03-27 12:28:39,482 WARN HiveActionExecutor:523 - SERVER[] USER[hdfs] GROUP[-] TOKEN[] APP[test_workflow] JOB[0000049-170319180732598-oozie-oozi-W] ACTION[0000049-170319180732598-oozie-oozi-W@test_query] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.HiveMain], exception invoking main(), java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found 2017-03-27 12:28:39,483 WARN HiveActionExecutor:523 - SERVER[] USER[hdfs] GROUP[-] TOKEN[] APP[test_workflow] JOB[0000049-170319180732598-oozie-oozi-W] ACTION[0000049-170319180732598-oozie-oozi-W@test_query] Launcher exception: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2214) at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:240) at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54) at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162) Caused by: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.HiveMain not found at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2120) at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2212) ... 9 more

Highlighted

Re: Oozie Hive Action Class Not Found Exception

Contributor

When i run this i get:

oozie admin -oozie http://host:11000/oozie -shareliblist

[Available ShareLib]

hive

distcp

mapreduce-streaming

spark

oozie

hcatalog

hive2

sqoop

pig

spark_orig

Highlighted

Re: Oozie Hive Action Class Not Found Exception

Explorer

Looks like some jar missing from classpath. Just realized this is more related to Oozie than Hive. Sorry I don't have more insights here. This might help:

https://community.cloudera.com/t5/Batch-Processing-and-Workflow/Hive-action-failing-in-Oozie-workflo...

Re: Oozie Hive Action Class Not Found Exception

Super Mentor

@Josh Persinger

Sometimes it happens when Oozie is having trouble referencing the proper oozie-sharelib-hive-<HDP Version>.jar

You should try to regenerate the oozie sharelib

1. Get a listing of hive sharelib content:

# oozie admin -oozie http://${OOZIE_HOST}:11000/oozie -shareliblist hive* > /tmp/hive_shareliblist_OLD.txt 2>&1

2. Now we will recreate the sharelib

# /usr/hdp/<HDP Version>/oozie/bin/oozie-setup.sh sharelib create -fs hdfs://${NAMENODE}

3. Again list the hive sharelib contents now.

# oozie admin -oozie http://${OOZIE_HOST}:11000/oozie -shareliblist hive* > /tmp/hive_shareliblist_NEW.txt 2>&1

4. For double verification list all hive sharelib directories in HDFS

# hdfs dfs -ls -R /user/oozie/share/lib/*/hive/* > /tmp/hive_libs_on_hdfs.txt 2>&1

5. Edit the "workflow.xml" and remove the line:

<property> 
     <name>oozie.libpath</name> 
     <value>${nameNodeHost:8020}/user/oozie/share/lib/lib_20170116233431</value>
</property>

6. Modify the "job.properties" file and set the following property to true. The restart the oozie/job

oozie.use.system.libpath=true 

.

.

Don't have an account?
Coming from Hortonworks? Activate your account here