Example usage for javax.ejb EJBException getMessage

List of usage examples for javax.ejb EJBException getMessage

Introduction

In this page you can find the example usage for javax.ejb EJBException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.signserver.admin.gui.MainView.java

private void showServerSideException(final EJBException ex) {
    JOptionPane.showMessageDialog(MainView.this.getFrame(), ex.getMessage(), "Operation failed on server side",
            JOptionPane.ERROR_MESSAGE);
}

From source file:ru.codeinside.gses.manager.ManagerService.java

public Procedure createProcedure(String name, String description, String serviceId, Long code, String login,
        ProcedureType type) {/*from  ww w .  ja  v a 2  s  .com*/
    try {
        if (hasProcedureWithSameRegisterCode(code)) {
            throw new RuntimeException(
                    " ?    ??");
        }
        final Procedure procedure = new Procedure();
        mergeProcedure(procedure, name, description, serviceId, code, type);
        procedure.setCreator(em.find(Employee.class, login));
        em.persist(procedure);
        return procedure;
    } catch (EJBException e) {
        final String message;
        if (e.getMessage() != null) {
            message = e.getMessage();
        } else if (e.getCausedByException() != null) {
            message = e.getCausedByException().getMessage();
        } else {
            message = e.getCause() != null ? e.getCause().getMessage() : e.getClass().toString();
        }
        throw new RuntimeException(message);
    }
}