public void handleException(Exception throwable) { log.error("Exception thrown whilst executing asynchronous call", throwable); }
private List<PollRequest> unmarshalRequests(Element env) throws Exception { try { List<PollRequest> requests = new ArrayList<PollRequest>(); List<Element> requestElements = env.element("body").elements("poll"); for (Element e : requestElements) { requests.add(new PollRequest(e.attributeValue("token"), Integer.parseInt(e.attributeValue("timeout")))); } return requests; } catch (Exception ex) { log.error("Error unmarshalling subscriptions from request", ex); throw ex; } }
log.error(String.format("Resource [%s] not found.", resourceName));
@Create public void startup() throws Exception { try { log.trace("GWT14Service starting up"); Class policyProviderClass = Class.forName(SERIALIZATION_POLICY_PROVIDER_CLASS); Class serializationPolicyClass = Class.forName(SERIALIZATION_POLICY_CLASS); streamReaderConstructor = ServerSerializationStreamReader.class.getConstructor( new Class[] { ClassLoader.class, policyProviderClass } ); streamWriterConstructor = ServerSerializationStreamWriter.class.getConstructor( new Class[] { serializationPolicyClass } ); Class legacySerializationPolicyClass = Class.forName(LEGACY_SERIALIZATION_POLICY_CLASS); Method m = legacySerializationPolicyClass.getDeclaredMethod("getInstance"); legacySerializationPolicy = m.invoke(null); } catch (Exception ex) { log.error("Error initializing GWT14Service. Please ensure " + "the GWT 1.4 libraries are in the classpath."); throw ex; } }
public void error(Object object, Object... params) { if ( isErrorEnabled() ) { log.error( interpolate(object, params) ); } } public void error(Object object, Throwable t, Object... params)
public void error(Object object, Throwable t, Object... params) { if ( isErrorEnabled() ) { log.error( interpolate(object, params), t ); } } public void fatal(Object object, Object... params)
@SuppressWarnings("finally") private Object interpolate(Object object, Object... params) { if (object instanceof String) { try { object = Interpolator.instance().interpolate( (String) object, params ); } catch (Exception e) { log.error("exception interpolating string: " + object, e); } finally { return object; } } else { return object; } }
log.error(String.format("Component not found: [%s]", componentName)); throw new ServletException("Invalid request - component not found.");
public RemoteSubscriber subscribe(String topicName) { if (!allowedTopics.contains(topicName)) { throw new IllegalArgumentException(String.format( "Cannot subscribe to a topic that is not allowed. Topic [%s] is not an " + "allowed topic.", topicName)); } RemoteSubscriber sub = new RemoteSubscriber(UUID.randomUUID().toString(), topicName); try { subscribe(sub); subscriptions.put(sub.getToken(), sub); // Save the client's token in their session context getUserTokens().add(sub.getToken()); return sub; } catch (Exception ex) { log.error(ex); return null; } }
log.error("Error", ex);
void afterTransactionCompletion(boolean success) { if ( Events.exists() ) { Events.instance().raiseEvent("org.jboss.seam.afterTransactionCompletion", success); } for (Synchronization sync: synchronizations) { try { sync.afterCompletion(success ? Status.STATUS_COMMITTED : Status.STATUS_ROLLEDBACK); } catch (Exception e) { log.error("Exception processing transaction Synchronization after completion", e); } } synchronizations.clear(); }
private Properties loadFromResource(String resource) { Properties props = new Properties(); InputStream stream = Resources.getResourceAsStream(resource, servletContext); if (stream != null) { try { log.info("reading properties from: " + resource); try { props.load(stream); } catch (IOException ioe) { log.error("could not read " + resource, ioe); } } finally { Resources.closeStream(stream); } } else { log.debug("not found: " + resource); } return props; }
log.error("error adding event listener " + eventListener + " - bypassing.");
void beforeTransactionCompletion() { if ( Events.exists() ) { Events.instance().raiseEvent("org.jboss.seam.beforeTransactionCompletion"); } for (Synchronization sync: synchronizations) { try { sync.beforeCompletion(); } catch (Exception e) { log.error("Exception processing transaction Synchronization before completion", e); } } }
protected void rollbackTransactionIfNecessary() { try { UserTransaction transaction = Transaction.instance(); if ( transaction.isActiveOrMarkedRollback() || transaction.isRolledBack() ) { log.debug("killing transaction"); transaction.rollback(); } } catch (Exception te) { log.error("could not roll back transaction", te); } } }
@Create public void init() { if (featureSet == null) { featureSet = new FeatureSet(); featureSet.enableAll(); } if (entityManager == null) { entityManager = Expressions.instance().createValueExpression("#{entityManager}", EntityManager.class); } if (userClass == null) { log.error("Error in JpaIdentityStore configuration - userClass must be configured."); return; } initProperties(); }
public void beforePhase(PhaseEvent event) { log.trace( "before phase: " + event.getPhaseId() ); FacesLifecycle.setPhaseId( event.getPhaseId() ); try { if ( isPortletRequest(event) ) { beforePortletPhase(event); } else { beforeServletPhase(event); } raiseEventsBeforePhase(event); } catch (Exception e) { try { Exceptions.instance().handle(e); } catch (Exception ehe) { log.error("swallowing exception", e); } } }
/** * Inbound message handler. Seam contexts should be initialized here, and * the conversation ID (if present) is extracted from the request. * * @param messageContext The message context * @return boolean true if processing should continue */ public boolean handleInbound(MessageContext messageContext) { try { HttpServletRequest request = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST); ServletLifecycle.beginRequest(request, ServletLifecycle.getServletContext()); ServletContexts.instance().setRequest(request); String conversationId = extractConversationId(messageContext); ConversationPropagation.instance().setConversationId( conversationId ); Manager.instance().restoreConversation(); ServletLifecycle.resumeConversation(request); return true; } catch (SOAPException ex) { log.error("Error handling inbound SOAP request", ex); return false; } }
log.error("swallowing exception", e);
log.error("Exception processing outbound message", ex); return false;