title: Submit Oozie Job from another job's java action with Kerberos
body: <p>I am trying to submit an Oozie job using <a href="https://oozie.apache.org/docs/3.2.0-incubating/DG_Examples.html#Java_API_Example" rel="nofollow noreferrer">Java Client API</a> from another Job's java action. The cluster is using Kerberos. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>// get a OozieClient for local Oozie
      String oozieUrl = "http://hadooputl02.northamerica.xyz.net:11000/oozie/";
      AuthOozieClient wc = new AuthOozieClient(oozieUrl);
  
      wc.setDebugMode(1);
  // create a workflow job configuration and set the workflow application path
      Properties conf = wc.createConfiguration();
      conf.setProperty(OozieClient.APP_PATH, wfAppPath);
      conf.setProperty("jobTracker", "yarnRM");
      conf.setProperty("nameNode", "hdfs://ingestiondev");
  
  // submit and start the workflow job
      String jobId = wc.run(conf);
      System.out.println("Workflow job submitted");
  </code></pre>
  
  <p>But I am getting the following error:</p>
  
  <pre><code> org.apache.oozie.action.hadoop.JavaMainException: IO_ERROR : 
  java.io.IOException: Error while connecting Oozie server. No of retries = 1. Exception = Could not authenticate, GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
        ...
   Caused by: AUTHENTICATION : Could not authenticate, GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
        ...
  Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
        ...
  Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
  </code></pre>
  
  <p>I believe there is something more required in the code to give the node/user access to the oozie server through kerberos.</p>
  
  <p>Can someone point me to the correct way to use Oozie Java API on a Kerberized cluster?</p>
  
  <p>thanks!</p>