title: Writing to file from jar run from Oozie shell
body: <p>I have <code>jar</code> file that needs to be run before running our map reduce process. This is going to process the data to be fed in later to the map reduce process. The <code>jar</code> file works fine without <code>oozie</code>, but I like to automate the workflow.</p>
  
  <p>The <code>jar</code> if runs should accept two inputs: <code>&lt;input_file&gt;</code> and <code>&lt;output_dir&gt;</code>
  And it should be expected to output two files <code>&lt;output_file_1&gt;</code>, <code>&lt;output_file_2&gt;</code> under the <code>&lt;output_dir&gt;</code> specified.</p>
  
  <p>This is the workflow:</p>
  
  <pre><code>&lt;workflow-app name="RI" xmlns="uri:oozie:workflow:0.4"&gt;
      &lt;start to="RI"/&gt;
      &lt;action name="RI"&gt;
          &lt;shell xmlns="uri:oozie:shell-action:0.1"&gt;
              &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
              &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
              &lt;exec&gt;java &lt;/exec&gt;
                &lt;argument&gt;-jar&lt;/argument&gt;
                &lt;argument&gt;RI-Sequencer.jar &lt;/argument&gt;
                &lt;argument&gt;log.csv&lt;/argument&gt;
                &lt;argument&gt;/tmp&lt;/argument&gt;
              &lt;file&gt;/user/root/algo/RI-Sequencer.jar#RI-Sequencer.jar&lt;/file&gt;
              &lt;file&gt;/user/root/algo/log.csv#log.csv&lt;/file&gt;
                &lt;capture-output/&gt;
          &lt;/shell&gt;
          &lt;ok to="end"/&gt;
          &lt;error to="kill"/&gt;
      &lt;/action&gt;
      &lt;kill name="kill"&gt;
          &lt;message&gt;Action 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 run the task using <code>Hue</code>, and currently I can't get the output of the process to be written to files. It runs fine, but the supposed files are no where to be found.</p>
  
  <p>I have also changed the output directory to be in HDFS, but with same result, no files are generated.</p>
  
  <p>If it helps, this is sample of codes from my <code>jar</code> file:</p>
  
  <pre><code>File fileErr = new File(targetPath + "\\input_RI_err.txt");
  fileErr.createNewFile();
  textFileErr = new BufferedWriter(new FileWriter(fileErr));
  // 
  // fill in the buffer with the result
  //
  textFileErr.close();
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  If it helps, I can upload the jar file for testing.</p>
  
  <p><strong>UPDATE 2:</strong>
  I've changed to make it write to HDFS. Still not working when using Oozie to execute the job. Running the job independently works.</p>