Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

ProtoBuffer exception when submitting Oozie Job

$
0
0

I’m trying to submit a job to an Oozie server using the apache OozieClient (the job in question isn’t important for the moment. I just need to submit any job as a test). I’m thoroughly confused about how to do so, but I’m getting an unexpected ProtoBuffer related exception when I do.

The code I’m using, partially modified from http://oozie.apache.org/docs/4.1.0/DG_Examples.html.

I think I have the correct value for OOZIE_URL, but I’m unsure how to determine the job-tracker url or proper value of the OOZIE_CLIENT.APP_PATH.

   public static final String HADOOP_URL = "http://10.1.2.88";
    public static final String HDFS_URL = "hdfs://10.1.2.88";
    private static final String OOZIE_URL = HADOOP_URL + ":11000/oozie";
    private static final String JOB_TRACKER_URL = HADOOP_URL + ":10020";

    public void submitJobAsClient(String jobLoc) throws OozieClientException {
        OozieClient client = new OozieClient(OOZIE_URL);

        Properties conf = client.createConfiguration();
        conf.setProperty(OozieClient.APP_PATH, HDFS_URL + ":50070" + jobLoc);

        conf.setProperty("jobTracker", JOB_TRACKER_URL);
        conf.setProperty("inputDir", "/usr/guest/testdir/inputdir");
        conf.setProperty("outputDir", "/usr/guest/testdir/outputdir");

        String jobId = client.run(conf);
        while (client.getJobInfo(jobId).getStatus() == (WorkflowJob.Status.RUNNING)) {
            System.out.println("Workflow job running ...");
            try {
                Thread.sleep(10 * 1000);
            }
            catch (InterruptedException e) {
                // do nothing;
            }
        }

        // print the final status of the workflow job
        System.out.println("Workflow job completed ...");
        System.out.println(client.getJobInfo(jobId));
    }

The exception is:

d E0501 : E0501: Could not perform authorization operation, Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.; Host Details : local host is: "sandbox.hortonworks.com/10.1.2.88"; destination host is: "sandbox.hortonworks.com":50070;
	at org.apache.oozie.client.OozieClient.handleError(OozieClient.java:542)
	at org.apache.oozie.client.OozieClient$JobSubmit.call(OozieClient.java:625)
	at org.apache.oozie.client.OozieClient$JobSubmit.call(OozieClient.java:595)
	at org.apache.oozie.client.OozieClient$ClientCallable.call(OozieClient.java:514)
	at org.apache.oozie.client.OozieClient.run(OozieClient.java:756)
	at com.mg.util.hadoop.oozie.MGOozieClient.submitJobAsClient(MGOozieClient.java:62)
	at com.mg.util.hadoop.oozie.MGOozieClient.main(MGOozieClient.java:99)

I’m wondering why any call I make to OozieClient should create a ProtoBuffer error. Is that expected?


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>