Community Articles

Find and share helpful community-sourced technical articles.
Labels (2)
avatar

Problem:

Following upgrade to 2.5 Oozie Sqoop job which previously worked now fails with

oozi-W@sqoop-aa6c] Launcher exception: org/json/JSONObject
java.lang.NoClassDefFoundError: org/json/JSONObject
                at org.apache.sqoop.util.SqoopJsonUtil.getJsonStringforMap(SqoopJsonUtil.java:43)
                at org.apache.sqoop.SqoopOptions.writeProperties(SqoopOptions.java:759)
                at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.createInternal(HsqldbJobStorage.java:399)
                at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.create(HsqldbJobStorage.java:379)

Solution:

Ensure that 'java-json.jar' file exists in the following locations: /usr/hdp/current/sqoop-client/lib /usr/hdp/<version>/sqoop/lib

Also copy this jar into HDFS and reference it in your oozie workflow:

e.g.

hdfs dfs -put /usr/hdp/current/sqoop-client/lib/java-json.jar /user/oozie/oozie_scripts/lib/

and change workflow.xml:

<archive>/user/oozie/oozie_scripts/lib/java-json.jar#java-json.jar</archive>

1,931 Views
Comments

Can you eloberate more details as i am facing same issue and when i checked it i see the java-json.jar in the oozie shared lib path, However, i don't see it in the sqoop-client/lib path on the gateway.