Source:
<code>public void service(HttpServletRequest req, HttpServletResponse res) throws Exception { boolean debug = log.isDebugEnabled(); try { req.setCharacterEncoding("UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Encoding not supported", e); } String portalPath = req.getRequestURI().substring(req.getContextPath().length()); Router router = routerRef.get(); if (router != null) { Iterator<Map<QualifiedName, String>> matcher = router.matcher(portalPath, req.getParameterMap()); boolean started = false; boolean processed = false; try { while (matcher.hasNext() && !processed) { Map<QualifiedName, String> parameters = matcher.next(); String handlerKey = parameters.get(HANDLER_PARAM); if (handlerKey != null) { WebRequestHandler handler = handlers.get(handlerKey); if (handler != null) { if (debug) { log.debug("Serving request path=" + portalPath + ", parameters=" + parameters + " with handler " + handler); } if (!started && handler.getRequiresLifeCycle()) { if (debug) { log.debug("Starting RequestLifeCycle for handler " + handler); } started = true; ExoContainer container = ExoContainerContext.getCurrentContainer(); if (!(container instanceof PortalContainer)) { <START> log.error("current container is " + container + ", it should be a PortalContainer instance to start a portal request lifecycle"); <END> } RequestLifeCycle.begin(container); } processed = handler.execute(new ControllerContext(this, router, req, res, parameters)); } else { if (debug) { log.debug("No handler " + handlerKey + " for request path=" + portalPath + ", parameters=" + parameters); } } } } } finally { if (started) { if (debug) { log.debug("Finishing RequestLifeCycle for current request"); } RequestLifeCycle.end(); } } if (!processed) { log.error("Could not associate the request path=" + portalPath + " with an handler"); res.sendError(HttpServletResponse.SC_NOT_FOUND); } } else { log.error("Missing valid router configuration " + configurationPathRef.get()); res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }</code><technical_language>If is error, fail process continue. customers/support do error/warn logs ? purpose is debug a problem</technical_language>

Target:
public void service(HttpServletRequest req, HttpServletResponse res) throws Exception { boolean debug = log.isDebugEnabled(); try { req.setCharacterEncoding("UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Encoding not supported", e); } String portalPath = req.getRequestURI().substring(req.getContextPath().length()); Router router = routerRef.get(); if (router != null) { Iterator<Map<QualifiedName, String>> matcher = router.matcher(portalPath, req.getParameterMap()); boolean started = false; boolean processed = false; try { while (matcher.hasNext() && !processed) { Map<QualifiedName, String> parameters = matcher.next(); String handlerKey = parameters.get(HANDLER_PARAM); if (handlerKey != null) { WebRequestHandler handler = handlers.get(handlerKey); if (handler != null) { if (debug) { log.debug("Serving request path=" + portalPath + ", parameters=" + parameters + " with handler " + handler); } if (!started && handler.getRequiresLifeCycle()) { started = true; ExoContainer container = ExoContainerContext.getCurrentContainer(); if (debug && !(container instanceof PortalContainer)) { log.debug("Starting RequestLifeCycle for handler " + handler); log.debug("current container is " + container + ", it should be a PortalContainer instance to start a portal request lifecycle"); } RequestLifeCycle.begin(container); } processed = handler.execute(new ControllerContext(this, router, req, res, parameters)); } else { if (debug) { log.debug("No handler " + handlerKey + " for request path=" + portalPath + ", parameters=" + parameters); } } } } } finally { if (started) { if (debug) { log.debug("Finishing RequestLifeCycle for current request"); } RequestLifeCycle.end(); } } if (!processed) { log.error("Could not associate the request path=" + portalPath + " with an handler"); res.sendError(HttpServletResponse.SC_NOT_FOUND); } } else { log.error("Missing valid router configuration " + configurationPathRef.get()); res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }