private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
/** * @see ExceptionHandler#getRootCause(Throwable) */ @Override public Throwable getRootCause(Throwable t) { if (t == null) { return null; } if (shouldUnwrap(t.getClass())) { Throwable root = t.getCause(); if (root != null) { Throwable tmp = getRootCause(root); if (tmp == null) { return root; } else { return tmp; } } else { return t; } } return t; }
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = try { Throwable t = context.getException(); if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) { handled = event; Throwable unwrapped = getRootCause(t); if (unwrapped != null) { throw new FacesException(unwrapped.getMessage(), unwrapped); log(context);
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
private void log(ExceptionQueuedEventContext exceptionContext) { Throwable t = exceptionContext.getException(); UIComponent c = exceptionContext.getComponent(); if (t instanceof UpdateModelException) { FacesContext context = FacesContext.getCurrentInstance(); FacesMessage message = ((UpdateModelException)t).getFacesMessage(); LOGGER.log(Level.SEVERE, message.getSummary(), t.getCause()); context.addMessage(c.getClientId(context), message); } else { boolean beforePhase = exceptionContext.inBeforePhase(); boolean afterPhase = exceptionContext.inAfterPhase(); PhaseId phaseId = exceptionContext.getPhaseId(); String key = getLoggingKey(beforePhase, afterPhase); if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, key, new Object[]{t.getClass().getName(), phaseId.toString(), ((c != null) ? c.getClientId(exceptionContext.getContext()) : ""), t.getMessage()}); LOGGER.log(Level.SEVERE, t.getMessage(), t); } } }
/** * @see ExceptionHandler#getRootCause(Throwable) */ @Override public Throwable getRootCause(Throwable t) { if (t == null) { return null; } if (shouldUnwrap(t.getClass())) { Throwable root = t.getCause(); if (root != null) { Throwable tmp = getRootCause(root); if (tmp == null) { return root; } else { return tmp; } } else { return t; } } return t; }
/** * @see ExceptionHandler#getRootCause(Throwable) */ @Override public Throwable getRootCause(Throwable t) { if (t == null) { return null; } if (shouldUnwrap(t.getClass())) { Throwable root = t.getCause(); if (root != null) { Throwable tmp = getRootCause(root); if (tmp == null) { return root; } else { return tmp; } } else { return t; } } return t; }