private static void handleException(Exception e) { // none of these exceptions should occure in real life. LOG.error("error while delegating resource handling to myfaces impl", e); }
private void logError(Exception e) { LOGGER.error(MessageFormat.format("Exception invoking listener: {0}", e.getMessage()), e); }
public URL apply(String from) { try { File file = new File(from); if (file.exists()) { return file.toURI().toURL(); } } catch (MalformedURLException e) { log.error("Bad URL in classpath", e); } return null; } };
private void cancel() { for (UploadedFile uploadedFile : uploadedFiles) { try { uploadedFile.delete(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } }
private void cancel() { for (UploadedFile uploadedFile : uploadedFiles) { try { uploadedFile.delete(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } }
@Override public void onThrowable(AtmosphereResourceEvent event) { // TODO Auto-generated method stub Throwable throwable = event.throwable(); LOGGER.error(throwable.getMessage(), throwable); }
@Override public void destroy() { for (JMSConsumerContext jmsConsumerContext : jmsConsumerContexts.asMap().values()) { try { jmsConsumerContext.stop(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } } super.destroy(); }
public static String encodeBytesData(byte[] data) { if (data != null) { try { byte[] dataArray = encrypt(data); return new String(dataArray, "ISO-8859-1"); } catch (Exception e) { RESOURCE_LOGGER.error(Messages.getMessage(Messages.QUERY_STRING_BUILDING_ERROR), e); } } return null; }
public void release() { super.release(); if (uploadedFiles != null) { for (UploadedFile uploadedFile : uploadedFiles) { try { uploadedFile.delete(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } } }
public void release() { super.release(); if (uploadedFiles != null) { for (UploadedFile uploadedFile : uploadedFiles) { try { uploadedFile.delete(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } } }
public static Date parseHttpDate(String s) { Date result = null; if (s != null) { try { result = (Date) ((Format) RFC1123_DATE_FORMATTER.clone()).parseObject(s); } catch (ParseException e) { RESOURCE_LOGGER.error(e.getMessage(), e); } } return result; }
private void initialize() { Manifest manifest = null; try { manifest = readManifest(); } catch (Exception e) { LOGGER.error(MessageFormat.format("Error reading project metadata: {0}", e.getMessage()), e); } if (manifest != null) { initializePropertiesFromManifest(manifest); initializeDerivativeProperties(); } }
/** * Initializes {@link org.richfaces.application.push.PushContext} on startup as it is a time when {@link FacesContext} is available */ private void initializePushContext() { try { LOGGER.info("Startup initialization of PushContext"); ServiceTracker.getService(PushContextFactory.class).getPushContext(); } catch (Exception e) { LOGGER.error(MessageFormat.format("There were problems initializing PushContext on startup: {0}", e.getMessage())); } }
private void printResponse(FacesContext facesContext, MultipartRequest multipartRequest) { facesContext.responseComplete(); ExternalContext externalContext = facesContext.getExternalContext(); externalContext.setResponseStatus(HttpServletResponse.SC_OK); externalContext.setResponseContentType("text/html"); try { Writer writer = externalContext.getResponseOutputWriter(); writer.write("<html id=\"" + FileUploadFacesContextFactory.UID_KEY + multipartRequest.getUploadId() + ":" + multipartRequest.getResponseState() + "\"/>"); writer.close(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } }
@Override public synchronized void destroy() { active = false; for (TopicKey key : successfulSubscriptions) { Topic topic = topicsContext.getTopic(key); topic.publishEvent(new SessionUnsubscriptionEvent(topic, key, this)); } try { disconnect(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } }
public void encode() throws java.io.IOException { Object initialRowKey = tree.getRowKey(); try { tree.setRowKey(context, null); encodeTree(); } finally { try { tree.setRowKey(context, initialRowKey); } catch (Exception e) { TreeRendererBase.LOGGER.error(e.getMessage(), e); } } } }
public void encode() throws java.io.IOException { Object initialRowKey = tree.getRowKey(); try { tree.setRowKey(context, null); encodeTree(); } finally { try { tree.setRowKey(context, initialRowKey); } catch (Exception e) { TreeRendererBase.LOGGER.error(e.getMessage(), e); } } } }
public void encode() throws java.io.IOException { Object initialRowKey = tree.getRowKey(); try { tree.setRowKey(context, null); encodeTree(); } finally { try { tree.setRowKey(context, initialRowKey); } catch (Exception e) { TreeRendererBase.LOGGER.error(e.getMessage(), e); } } } }
private void parseIfNecessary() { if (responseState != null) { return; } try { requestParser.parse(); uploadedFiles = requestParser.getUploadedFiles(); params = requestParser.getParameters(); responseState = ResponseState.ok; } catch (FileUploadException e) { LOGGER.error(e.getMessage(), e); responseState = ResponseState.serverError; } }
private void parseIfNecessary() { if (responseState != null) { return; } try { requestParser.parse(); uploadedFiles = requestParser.getUploadedFiles(); params = requestParser.getParameters(); responseState = ResponseState.ok; } catch (FileUploadException e) { LOGGER.error(e.getMessage(), e); responseState = ResponseState.serverError; } }