title: Schedule a scala file using oozie?
body: <p>How do I run/schedule a .scala file which I run using spark-shell command using oozie?</p>
  
  <p>I run this file using <strong><em>spark-shell -i combined.scala</em></strong><br>
      command!</p>
  
  <p>I was wondering if something specific like how we schedule pig jobs in oozie is present here!</p>
  
  <p>As per David's suggestion I have created the xml:</p>
  
  <pre><code>&lt;workflow-app xmlns='uri:oozie:workflow:0.2' name='oozie-java-spark-wf'&gt;
     &lt;start to='java-spark' /&gt;
  
     &lt;action name='java-spark'&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;yarn-cluster&lt;/master&gt;
              &lt;name&gt;Spark Patent Citation&lt;/name&gt;
              &lt;class&gt;org.apache.spark.repl.Main&lt;/class&gt;
              &lt;jar&gt;&lt;/jar&gt;
              &lt;arg&gt;-i&lt;/arg&gt;
              &lt;arg&gt;${nameNode}/user/hdfs/scala_file/combined.scala&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;Spark Java PatentCitation 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>I am getting an error like this:</p>
  
  <p>Error Code  JA018
  Error Message   Main class [org.apache.oozie.action.hadoop.SparkMain], main() threw exception, null</p>
  
  <p>Where am I going wrong?</p>