Reply
Highlighted
gkb
Explorer
Posts: 14
Registered: ‎01-09-2014
Accepted Solution

Oozie-Java Action-ClassNotFoundException

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>"

 

Cloudera Employee
Posts: 717
Registered: ‎07-30-2013

Re: Oozie-Java Action-ClassNotFoundException

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.

 

 

gkb
Explorer
Posts: 14
Registered: ‎01-09-2014

Re: Oozie-Java Action-ClassNotFoundException

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

 

 

 

 

Cloudera Employee
Posts: 717
Registered: ‎07-30-2013

Re: Oozie-Java Action-ClassNotFoundException

Could you share the XML of the workflow?

gkb
Explorer
Posts: 14
Registered: ‎01-09-2014

Re: Oozie-Java Action-ClassNotFoundException

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

Cloudera Employee
Posts: 717
Registered: ‎07-30-2013

Re: Oozie-Java Action-ClassNotFoundException

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.

gkb
Explorer
Posts: 14
Registered: ‎01-09-2014

Re: Oozie-Java Action-ClassNotFoundException

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!

Cloudera Employee
Posts: 717
Registered: ‎07-30-2013

Re: Oozie-Java Action-ClassNotFoundException

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

 

Announcements