Example usage for java.lang RuntimeException getMessage

List of usage examples for java.lang RuntimeException getMessage

Introduction

In this page you can find the example usage for java.lang RuntimeException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.espertech.esper.core.thread.OutboundUnitRunnable.java

public void run() {
    try {//from ww w.  ja va2 s.  c  o  m
        statementResultService.processDispatch(events);
    } catch (RuntimeException e) {
        log.error("Unexpected error processing dispatch: " + e.getMessage(), e);
    }
}

From source file:com.espertech.esper.core.thread.InboundUnitSendWrapped.java

public void run() {
    try {//w  w w.j  a  v  a 2 s  . c om
        runtime.processWrappedEvent(eventBean);
    } catch (RuntimeException e) {
        log.error("Unexpected error processing wrapped event: " + e.getMessage(), e);
    }
}

From source file:com.espertech.esper.core.thread.InboundUnitSendEvent.java

public void run() {
    try {//  ww  w  .  j a  va 2 s .  co m
        runtime.processEvent(theEvent);
    } catch (RuntimeException e) {
        log.error("Unexpected error processing unwrapped event: " + e.getMessage(), e);
    }
}

From source file:com.espertech.esper.core.thread.InboundUnitSendDOM.java

public void run() {
    try {//w w  w .j  av a 2s  .c om
        EventBean eventBean = services.getEventAdapterService().adapterForDOM(theEvent);
        runtime.processEvent(eventBean);
    } catch (RuntimeException e) {
        log.error("Unexpected error processing DOM event: " + e.getMessage(), e);
    }
}

From source file:com.mycompany.projetsportmanager.spring.rest.exceptions.SportManagerResponseEntityExceptionHandler.java

@ExceptionHandler(RuntimeException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody// w w  w .ja  v a 2 s  .co m
public ErrorResource processValidationError(RuntimeException ex) {
    return new ErrorResource("uncatched exception", ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
}

From source file:com.espertech.esper.core.thread.InboundUnitSendMap.java

public void run() {
    try {// w ww. j av a2s . c  o m
        EventBean eventBean = services.getEventAdapterService().adapterForMap(map, eventTypeName);
        runtime.processWrappedEvent(eventBean);
    } catch (RuntimeException e) {
        log.error("Unexpected error processing Map event: " + e.getMessage(), e);
    }
}

From source file:org.dspace.app.cris.ws.WSTokenAuthService.java

@Override
protected Element invokeInternal(Element arg0) throws Exception {

    TransportContext context = TransportContextHolder.getTransportContext();
    HttpServletConnection connection = (HttpServletConnection) context.getConnection();
    HttpServletRequest request = connection.getHttpServletRequest();
    String ipAddress = request.getRemoteAddr();

    String token = tokenExpression.valueOf(arg0);
    String type = typeExpression.valueOf(arg0);
    type = type.trim();//from w  w w .  j  a  va2s . c  om
    User userWS = null;
    try {
        userWS = authenticationWS.authenticateToken(ipAddress, token);
    } catch (RuntimeException e) {
        throw new SOAPException(e.getMessage());
    }
    if (userWS == null) {
        throw new RuntimeException("User not found!");
    }

    if (!userWS.isEnabled()) {
        throw new RuntimeException("User disabled! Please Contact Admnistrator");
    }

    if (!AuthorizationWS.authorize(userWS, type)) {
        throw new SOAPException("User not allowed to retrieve those informations. Contact Administrator");
    }
    return buildResult(userWS, arg0, "TokenAuthQueryResponse");

}

From source file:de.micromata.genome.jpa.EmgrFactory.java

/**
 * Convert exception./*from  w  w w  .  j a  v  a 2  s . co m*/
 *
 * @param ex the ex
 * @return the runtime exception
 */
public static RuntimeException convertException(RuntimeException ex) {
    if (ex instanceof QueryTimeoutException) {
        // this is a oracle/hibernate bug workouround.
        // hibernate think this is is a query timeout, but should a DataException
        if (ex.getCause() instanceof org.hibernate.QueryTimeoutException) {
            org.hibernate.QueryTimeoutException qto = (org.hibernate.QueryTimeoutException) ex.getCause();
            if (qto.getCause() instanceof SQLException) {
                SQLException sqlex = (SQLException) qto.getCause();
                // ORA-12899
                if (sqlex.getErrorCode() == 12899) {
                    return new DataPersistenceException(ex.getMessage(), qto.getSQL(), sqlex.getSQLState(), ex);
                }
            }
        }
    }
    if (ex instanceof PersistenceException) {
        Throwable cause = ex.getCause();
        if (cause instanceof ConstraintViolationException) {
            ConstraintViolationException cve = (ConstraintViolationException) cause;
            cve.getMessage();
            String sql = cve.getSQL();
            return new ConstraintPersistenceException(cve.getMessage(), sql, cve.getSQLState(),
                    cve.getConstraintName(), ex);
        } else if (cause instanceof DataException) {
            DataException dex = (DataException) cause;
            return new DataPersistenceException(ex.getMessage(), dex.getSQL(), dex.getSQLState(), ex);
        } else if (cause instanceof PropertyValueException) {
            if (StringUtils.startsWith(cause.getMessage(), "not-null ") == true) {
                return new NullableConstraintPersistenceException(ex.getMessage(), ex);
            }
        }
    }
    return ex;
}

From source file:io.cloudslang.lang.compiler.validator.SystemPropertyValidatorImpl.java

private void validateItem(String input, String errorMessage) {
    try {/* w w  w  . j a va2s  . c  o  m*/
        validateNamespaceRules(input);
    } catch (RuntimeException rex) {
        throw new RuntimeException(errorMessage + " Nested exception is: " + rex.getMessage(), rex);
    }
}

From source file:com.espertech.esper.core.thread.InboundUnitSendObjectArray.java

public void run() {
    try {//from   w w w  .  ja va  2  s  .  c om
        EventBean eventBean = services.getEventAdapterService().adapterForObjectArray(properties,
                eventTypeName);
        runtime.processWrappedEvent(eventBean);
    } catch (RuntimeException e) {
        log.error("Unexpected error processing Object-array event: " + e.getMessage(), e);
    }
}