0

我正在尝试使用 javacode 启动 oozie 作业,但无法执行相同操作。以下代码为几行提供了异常“未处理的类型 oozieClientException”,例如

String jobId = wc.run(conf);

我是java新手,正在寻求帮助。这是我的代码:

    OozieClient wc = new OozieClient("http://host.com:11000/oozie");

    Properties conf = wc.createConfiguration();
    conf.setProperty(....)
    ...
    String jobId = wc.run(conf);
    System.out.println("Workflow job submitted");

    while (wc.getJobInfo(jobId).getStatus() == WorkflowJob.Status.RUNNING) {
       System.out.println("Workflow job running ...");
       Thread.sleep(10 * 1000);
    }
    System.out.println("Workflow job completed ...");


    System.out.println(wc.getJobInfo(jobId)); 
4

1 回答 1

0

您应该关闭 try catch 块中的代码

try{
    OozieClient wc = new OozieClient("http://host.com:11000/oozie");

    Properties conf = wc.createConfiguration();
    conf.setProperty(....)
    ...
    String jobId = wc.run(conf);
    System.out.println("Workflow job submitted");

    while (wc.getJobInfo(jobId).getStatus() == WorkflowJob.Status.RUNNING) {
       System.out.println("Workflow job running ...");
       Thread.sleep(10 * 1000);
    }
    System.out.println("Workflow job completed ...");


    System.out.println(wc.getJobInfo(jobId)); 
}catch(OozieClientException oozieClientException){
    oozieClientException.printStackTrace();
}

OozieClientException - 如果无法提交作业,则抛出

于 2012-10-11T11:47:21.567 回答