Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Oozie-Java Action-ClassNotFoundException

avatar
Explorer

I am using CDH 4.4 and trying to run "HelloWorld" java action in oozie (Web UI).

I get "java.lang.ClassNotFoundException: Class HelloWorld not found".

I have uploaded the jar in the workflow`s workspace. Is there a place where i have to set the classpath?
Or is there anything else that i am missing?

Configuration:

Name Value

hue-id-w22
jobTrackerlocalhost.localdomain:8021
nameNodehdfs://localhost.localdomain:8020
oozie.use.system.libpathtrue
oozie.wf.application.pathhdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99
user.namecloudera

 

Definition:

"<workflow-app name="WF22" xmlns="uri:oozie:workflow:0.4">
    <start to="GBB12"/>
    <action name="GBB12">
        <java>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <main-class>HelloWorld</main-class>
            <arg>er</arg>
        </java>
        <ok to="end"/>
        <error to="kill"/>
    </action>
    <kill name="kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>"

 

1 ACCEPTED SOLUTION

avatar
Super Guru

Ha true.

 

Could you list the content of

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99

Specyfing the path in the 'Jar name' should have the file copied into a sub dir nameed lib?

 

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99/lib

 

If not it can be done manually:

 

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99/lib/MY...

 

If it does not work, could you share the logs of the action? Also make sure the class is in the jar.

View solution in original post

7 REPLIES 7

avatar
Super Guru

You need to add the jar in the HDFS workspace ('Workspace' in the menu of the Editor) of the Workflow and specify its name in the 'Jar name' field of the Java action.

 

Of just create a 'lib' dir in the workspace of the workflow and upload the jar there.

 

 

avatar
Explorer

I have uploaded the jar in the workspace which is

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99

 

I uploaded it while creating the java action using the UI in the name "Jar name" . Despite that i get the exception

 

 

 

 

avatar
Super Guru

Could you share the XML of the workflow?

avatar
Explorer

I didnot upload any extra xml.
The xml file generated by oozie as "workflow.xml" is posted in the question under the heading "Definition"

avatar
Super Guru

Ha true.

 

Could you list the content of

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99

Specyfing the path in the 'Jar name' should have the file copied into a sub dir nameed lib?

 

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99/lib

 

If not it can be done manually:

 

hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99/lib/MY...

 

If it does not work, could you share the logs of the action? Also make sure the class is in the jar.

avatar
Explorer

Creating a "lib" folder manually in hdfs://localhost.localdomain:8020/user/hue/oozie/workspaces/_cloudera_-oozie-22-1389296910.99

and placing the jar inside the "lib" folder helped!

 

Now my java action runs successfully.

 

Can you please share the documentation of using the Web UI if there is one?

 

Thanks!

avatar
Super Guru

Awesome!

 

You can click on the Help icon in the naviation bar.

 

Also see thr blog with video and tutorials:

http://gethue.tumblr.com/

 

Or look at the documentation of a release:

http://cloudera.github.io/hue/docs-3.5.0/index.html

http://gethue.tumblr.com/tagged/release