List of usage examples for java.lang RuntimeException getMessage
public String getMessage()
From source file:com.nextep.datadesigner.sqlgen.impl.SynchronizationFilter.java
@Override public boolean match(ITypedObject object) { if (object == null) return false; if (object.getType() == getType() || getType() == null) { if (object instanceof INamedObject) { final INamedObject named = (INamedObject) object; try { return Pattern.matches(getName(), named.getName()); } catch (RuntimeException e) { LOGGER.error("Unable to compile synchronization filter '" + getName() + "': " + e.getMessage(), e);//w w w . j a v a 2s.c o m } } } return false; }
From source file:ar.com.fdvs.dj.core.registration.AbstractEntityRegistrationManager.java
public final void registerEntities(Collection entities) throws EntitiesRegistrationException { // this.columns = entities; log.debug("Registering entities: " + this.getClass().getName()); try {/*from www . ja v a2 s. co m*/ if (entities != null) { Iterator it = entities.iterator(); while (it.hasNext()) { Entity entity = (Entity) it.next(); registerEntity(entity); } } } catch (RuntimeException e) { throw new EntitiesRegistrationException(e.getMessage(), e); } finally { // this.columns = null; } }
From source file:org.resthub.rpc.hessian.SpringAMQPProxyTest.java
@Test(groups = "hessian-serialization") public void testException() throws Exception { String message = "Hello Hessian!"; try {// w w w. j a v a2 s . c o m echoServiceExceptionTest.exception(message); fail("No exception thrown"); } catch (RuntimeException e) { throw e; } catch (Exception e) { assertEquals("Exception message", message, e.getMessage()); } }
From source file:com.espertech.esper.filter.ExprNodeAdapterBase.java
protected boolean evaluatePerStream(EventBean[] eventsPerStream) { try {// w ww .ja v a 2s. com Boolean result = (Boolean) exprNodeEval.evaluate(eventsPerStream, true, this.evaluatorContext); if (result == null) { return false; } return result; } catch (RuntimeException ex) { log.error("Error evaluating expression '" + exprNode.toExpressionString() + "' statement '" + statementName + "': " + ex.getMessage(), ex); return false; } }
From source file:org.resthub.rpc.java.SpringAMQPProxyTest.java
@Test(groups = "java-serialization") public void testException() throws Exception { String message = "Hello Hessian!"; try {//from w ww.ja v a 2 s .c o m echoServiceExceptionTest.exception(message); fail("No exception thrown"); } catch (RuntimeException e) { throw e; } catch (Exception e) { assertEquals("Exception message", message, e.getMessage()); } }
From source file:org.resthub.rpc.SpringAMQPHessianProxyTest.java
@Test public void testException() throws Exception { String message = "Hello Hessian!"; try {/*w w w.j a v a 2s . c o m*/ echoServiceExceptionTest.exception(message); fail("No exception thrown"); } catch (RuntimeException e) { throw e; } catch (Exception e) { assertEquals("Exception message", message, e.getMessage()); } }
From source file:org.cleverbus.admin.web.msg.MessageOperationController.java
/** * Cancel next message processing.//from www.j a v a 2s . c o m * Only NEW and PARTLY_FAILED messages can be canceled. * * @param modelMap default view object for adding data to the view resolver (FTL) * @param messageID the message ID * @return name of the view */ @RequestMapping(value = "/cancelMessage", method = RequestMethod.POST) public String cancelMessage(@ModelAttribute("model") ModelMap modelMap, @RequestParam("messageID") Long messageID) { if (messageID == null) { modelMap.addAttribute(CANCEL_RESULT_ATTR, OP_NF); } else { try { service.cancelMessage(messageID); modelMap.addAttribute(CANCEL_RESULT_ATTR, CANCEL_OK); } catch (RuntimeException rex) { modelMap.addAttribute(CANCEL_RESULT_ATTR, CANCEL_NOK + ": " + rex.getMessage()); } } return VIEW_NAME; }
From source file:br.com.livraria.bean.FuncionarioBean.java
public void salvar() { try {/*w w w . j a v a2 s . c o m*/ FuncionarioDAO funcionarioDAO = new FuncionarioDAO(); funcionarioCadastro.setSenha(DigestUtils.md5Hex(funcionarioCadastro.getSenha())); funcionarioDAO.salvar(funcionarioCadastro); funcionarioCadastro = new Funcionario(); FacesUtil.adicionarMsgInfo("Funcionrio salvo com sucesso"); } catch (RuntimeException ex) { FacesUtil.adicionarMsgError("Erro ao tentar salvar funcionrio:" + ex.getMessage()); } }
From source file:br.com.livraria.bean.FuncionarioBean.java
public void carregarPesquisa() { try {/* ww w.j a v a 2 s .c om*/ FuncionarioDAO funcionarioDAO = new FuncionarioDAO(); listarFuncionarios = funcionarioDAO.listar(); } catch (RuntimeException ex) { FacesUtil.adicionarMsgError("Erro ao tentar listar os funcionrios:" + ex.getMessage()); } }
From source file:org.soitoolkit.commons.mule.jdbc.JdbcScriptEngine.java
public void execute(String scriptFilename, boolean ignoreErrors) throws FileNotFoundException { String s = MiscUtil.convertStreamToString(new FileInputStream(scriptFilename)); log.info("Execute JDBC-scriptfile: {}", scriptFilename); String[] sqlArr = s.split(";"); for (String sql : sqlArr) { if (sql != null && sql.trim().length() > 0) { try { log.debug("Execute: {}", sql); t.getJdbcOperations().execute(sql); } catch (RuntimeException e) { if (ignoreErrors) { log.debug("Ignore failed to execute sql command [" + sql + "], error: " + e.getMessage()); } else { log.warn("Failed to execute sql command [" + sql + "], error: " + e.getMessage()); throw e; }/*w ww . j a v a2 s . com*/ } } } log.info("Done executing JDBC-scriptfile: {}", scriptFilename); }