BigInsights on cloud - Class org.apache.oozie.action.hadoop.SparkMain not found
<p>I'm trying to execute the <a href="https://github.com/IBM-Bluemix/BigInsights-on-Apache-Hadoop/tree/oozie_spark/examples/OozieWorkflowSparkGroovy" rel="nofollow">spark oozie example</a> on the <a href="https://github.com/IBM-Bluemix/BigInsights-on-Apache-Hadoop/tree/oozie_spark" rel="nofollow">oozie_spark branch</a> against a BigInsights for Apache Hadoop basic cluster.</p>

<p>The workflow.xml looks like this:</p>

<pre><code>&lt;workflow-app xmlns='uri:oozie:workflow:0.5' name='SparkWordCount'&gt;
 &lt;start to='spark-node' /&gt;
  &lt;action name='spark-node'&gt;
   &lt;spark xmlns="uri:oozie:spark-action:0.1"&gt;
    &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
    &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
    &lt;master&gt;${master}&lt;/master&gt;
    &lt;name&gt;Spark-Wordcount&lt;/name&gt;
    &lt;class&gt;org.apache.spark.examples.WordCount&lt;/class&gt;
    &lt;jar&gt;${hdfsSparkAssyJar},${hdfsWordCountJar}&lt;/jar&gt;
    &lt;spark-opts&gt;--conf spark.driver.extraJavaOptions=-Diop.version=4.2.0.0&lt;/spark-opts&gt;
    &lt;arg&gt;${inputDir}/FILE&lt;/arg&gt;
    &lt;arg&gt;${outputDir}&lt;/arg&gt;
   &lt;/spark&gt;
   &lt;ok to="end" /&gt;
   &lt;error to="fail" /&gt;
  &lt;/action&gt;
  &lt;kill name="fail"&gt;
   &lt;message&gt;Workflow failed, error
    message[${wf:errorMessage(wf:lastErrorNode())}]
   &lt;/message&gt;
  &lt;/kill&gt;
 &lt;end name='end' /&gt;
&lt;/workflow-app&gt;
</code></pre>

<p>The configuration.xml:</p>

<pre><code>&lt;configuration&gt;
    &lt;property&gt;
        &lt;name&gt;master&lt;/name&gt;
        &lt;value&gt;local&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;queueName&lt;/name&gt;
        &lt;value&gt;default&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;user.name&lt;/name&gt;
        &lt;value&gt;default&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;nameNode&lt;/name&gt;
        &lt;value&gt;default&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;jobTracker&lt;/name&gt;
        &lt;value&gt;default&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;jobDir&lt;/name&gt;
        &lt;value&gt;/user/snowch/test&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;inputDir&lt;/name&gt;
        &lt;value&gt;/user/snowch/test/input&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;outputDir&lt;/name&gt;
        &lt;value&gt;/user/snowch/test/output&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;hdfsWordCountJar&lt;/name&gt;
        &lt;value&gt;/user/snowch/test/lib/OozieWorkflowSparkGroovy.jar&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;oozie.wf.application.path&lt;/name&gt;
        &lt;value&gt;/user/snowch/test&lt;/value&gt;
    &lt;/property&gt;
    &lt;property&gt;
        &lt;name&gt;hdfsSparkAssyJar&lt;/name&gt;
        &lt;value&gt;/iop/apps/4.2.0.0/spark/jars/spark-assembly.jar&lt;/value&gt;
    &lt;/property&gt;
&lt;/configuration&gt;
</code></pre>

<p>However, the error I see in the Yarn logs is:</p>

<pre><code>Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SparkMain], exception invoking main(), java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain not found
java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain not found
    at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2195)
    at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:234)
    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.LocalContainerLauncher$EventHandler.runSubtask(LocalContainerLauncher.java:380)
    at org.apache.hadoop.mapred.LocalContainerLauncher$EventHandler.runTask(LocalContainerLauncher.java:301)
    at org.apache.hadoop.mapred.LocalContainerLauncher$EventHandler.access$200(LocalContainerLauncher.java:187)
    at org.apache.hadoop.mapred.LocalContainerLauncher$EventHandler$1.run(LocalContainerLauncher.java:230)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: Class org.apache.oozie.action.hadoop.SparkMain not found
    at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2101)
    at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2193)
    ... 13 more
</code></pre>

<p>I've looked for SparkMain in spark-assembly:</p>

<pre><code>$ hdfs dfs -get /iop/apps/4.2.0.0/spark/jars/spark-assembly.jar
$ jar tf spark-assembly.jar | grep -i SparkMain
</code></pre>

<p>And here:</p>

<pre><code>$ jar tf /usr/iop/4.2.0.0/spark/lib/spark-examples-1.6.1_IBM_4-hadoop2.7.2-IBM-12.jar | grep SparkMain
</code></pre>

<p>I've seen another <a href="https://stackoverflow.com/questions/37410831/example-oozie-job-works-from-hue-but-not-from-command-line-sparkmain-not-found">question</a> similar to this one, but this question is specifically about BigInsights on cloud.</p>