private void load(Wrapper wrapper) { try { wrapper.load(); } catch (ServletException ex) { String message = sm.getString("standardContext.loadOnStartup.loadException", getName(), wrapper.getName()); if (getComputedFailCtxIfServletStartFails()) { throw new WebServerException(message, ex); } getLogger().error(message, StandardWrapper.getRootCause(ex)); } }
public void setObjectMaxSize(int objectMaxSize) { if (objectMaxSize * 1024L > Integer.MAX_VALUE) { log.warn(sm.getString("cache.objectMaxSizeTooBigBytes", Integer.valueOf(objectMaxSize))); this.objectMaxSize = Integer.MAX_VALUE; } // Internally bytes, externally kilobytes this.objectMaxSize = objectMaxSize * 1024; }
@Override public URL getURL() { String url = baseUrl + "!/"; try { return new URL(url); } catch (MalformedURLException e) { if (log.isDebugEnabled()) { log.debug(sm.getString("fileResource.getUrlFail", url), e); } return null; } }
private static void logFull(Log loghelper, int currentThreadCount, int maxThreads) { if( logfull ) { log.error(sm.getString("threadpool.busy", new Integer(currentThreadCount), new Integer(maxThreads))); logfull=false; } else if( log.isDebugEnabled() ) { log.debug("All threads are busy " + currentThreadCount + " " + maxThreads ); } }
protected void recycleSessionInfo() { if (session != null) { try { session.endAccess(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); log.warn(sm.getString("coyoteRequest.sessionEndAccessFail"), t); } } session = null; requestedSessionCookie = false; requestedSessionId = null; requestedSessionURL = false; requestedSessionSSL = false; }
private void process() { Set<BackgroundProcess> currentProcesses = new HashSet<>(); synchronized (processesLock) { currentProcesses.addAll(processes); } for (BackgroundProcess process : currentProcesses) { try { process.backgroundProcess(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); log.error(sm.getString( "backgroundProcessManager.processFailed"), t); } } }
private boolean checkOverflow(int numBytes) { if (pos + numBytes + 3 > buf.length) { log.error(sm.getString("ajpmessage.overflow", "" + numBytes, "" + pos), new ArrayIndexOutOfBoundsException()); if (log.isDebugEnabled()) { dump("Overflow/coBytes"); } return true; } return false; }
/** * Find the master of the session state * @return master member of sessions */ protected Member findSessionMasterMember() { Member mbr = null; Member mbrs[] = cluster.getMembers(); if(mbrs.length != 0 ) mbr = mbrs[0]; if(mbr == null && log.isWarnEnabled()) log.warn(sm.getString("deltaManager.noMasterMember",getName(), "")); if(mbr != null && log.isDebugEnabled()) log.warn(sm.getString("deltaManager.foundMasterMember",getName(), mbr)); return mbr; }
private void handleThrowableOnSend(Throwable t) throws WsIOException { ExceptionUtils.handleThrowable(t); wsSession.getLocal().onError(wsSession, t); CloseReason cr = new CloseReason(CloseCodes.CLOSED_ABNORMALLY, sm.getString("wsFrame.ioeTriggeredClose")); throw new WsIOException(cr); }
/** * Process a "stop" event for this Host. */ public void stop() { if (log.isDebugEnabled()) log.debug(sm.getString("hostConfig.stop")); if (oname != null) { try { Registry.getRegistry(null, null).unregisterComponent(oname); } catch (Exception e) { log.error(sm.getString("hostConfig.jmx.unregister", oname), e); } } oname = null; }
@Override public URL getURL() { try { return new URL(baseUrl + "!/"); } catch (MalformedURLException e) { if (log.isDebugEnabled()) { log.debug(sm.getString("fileResource.getUrlFail", "", baseUrl), e); } return null; } }
@Override protected String getPassword(String username) { // This method should never be called // Stack trace will show where this was called from UnsupportedOperationException uoe = new UnsupportedOperationException( sm.getString("combinedRealm.getPassword")); log.error(sm.getString("combinedRealm.unexpectedMethod"), uoe); throw uoe; }
private void handleOnOpenOrCloseError(Session session, Throwable t) { // If really fatal - re-throw ExceptionUtils.handleThrowable(t); // Trigger the error handler and close the session onError(session, t); try { session.close(); } catch (IOException ioe) { log.warn(sm.getString("pojoEndpointBase.closeSessionFail"), ioe); } }
private void process() { Set<BackgroundProcess> currentProcesses = new HashSet<>(); synchronized (processesLock) { currentProcesses.addAll(processes); } for (BackgroundProcess process : currentProcesses) { try { process.backgroundProcess(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); log.error(sm.getString( "backgroundProcessManager.processFailed"), t); } } }
private void handleThrowableOnSend(Throwable t) throws WsIOException { ExceptionUtils.handleThrowable(t); wsSession.getLocal().onError(wsSession, t); CloseReason cr = new CloseReason(CloseCodes.CLOSED_ABNORMALLY, sm.getString("wsFrame.ioeTriggeredClose")); throw new WsIOException(cr); }
/** * Process a "stop" event for this Host. */ public void stop() { if (log.isDebugEnabled()) log.debug(sm.getString("hostConfig.stop")); if (oname != null) { try { Registry.getRegistry(null, null).unregisterComponent(oname); } catch (Exception e) { log.error(sm.getString("hostConfig.jmx.unregister", oname), e); } } oname = null; }
@Override public URL getURL() { String url = baseUrl + "!/"; try { return new URL(url); } catch (MalformedURLException e) { if (log.isDebugEnabled()) { log.debug(sm.getString("fileResource.getUrlFail", url), e); } return null; } }
@Override protected Principal getPrincipal(String username) { // This method should never be called // Stack trace will show where this was called from UnsupportedOperationException uoe = new UnsupportedOperationException( sm.getString("combinedRealm.getPrincipal")); log.error(sm.getString("combinedRealm.unexpectedMethod"), uoe); throw uoe; }