Example usage for org.springframework.batch.core.repository JobInstanceAlreadyCompleteException printStackTrace

List of usage examples for org.springframework.batch.core.repository JobInstanceAlreadyCompleteException printStackTrace

Introduction

In this page you can find the example usage for org.springframework.batch.core.repository JobInstanceAlreadyCompleteException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:uk.ac.ebi.intact.editor.controller.admin.AdminJobController.java

public void restart(ActionEvent evt) {

    if (!evt.getComponent().getChildren().isEmpty()) {
        UIParameter param = (UIParameter) evt.getComponent().getChildren().iterator().next();

        long executionId = (Long) param.getValue();

        try {//  w w w. j  a va2  s  .c  o m
            getPsiMIJobManager().restartJob(executionId);

            addInfoMessage("Job restarted", "Execution ID: " + executionId);
        } catch (JobInstanceAlreadyCompleteException e) {
            addErrorMessage("Job is already complete " + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (NoSuchJobExecutionException e) {
            addErrorMessage("Job execution does not exist" + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (NoSuchJobException e) {
            addErrorMessage("Job does not exist" + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (JobRestartException e) {
            addErrorMessage("Problem restarting job" + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (JobParametersInvalidException e) {
            addErrorMessage("Job parameters are invalid" + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        }
    }
}

From source file:uk.ac.ebi.intact.editor.controller.dbmanager.ImportJobController.java

public void restart(ActionEvent evt) {

    if (!evt.getComponent().getChildren().isEmpty()) {
        UIParameter param = (UIParameter) evt.getComponent().getChildren().iterator().next();

        long executionId = (Long) param.getValue();

        try {// w w  w. ja v a 2s  . co  m
            getPsiMIJobManager().restartJob(executionId);

            addInfoMessage("Job restarted", "Execution ID: " + executionId);
            // remove old job instance
            getBatchJobService().deleteJob(executionId);

        } catch (JobInstanceAlreadyCompleteException e) {
            addErrorMessage("Job is already complete " + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (NoSuchJobExecutionException e) {
            addErrorMessage("Job execution does not exist " + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (NoSuchJobException e) {
            addErrorMessage("Job does not exist " + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (JobRestartException e) {
            addErrorMessage("Problem restarting job " + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        } catch (JobParametersInvalidException e) {
            addErrorMessage("Job parameters are invalid " + e.getMessage(), "Execution ID: " + executionId);
            e.printStackTrace();
        }
    }
}