Author: markt Date: Wed Jun 3 21:24:27 2009 New Revision: 781562 URL: http://svn.apache.org/viewvc?rev=781562&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37498 Redirect logging to container if context log is unavailable during context destruction
Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/LocalStrings.properties tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/LocalStrings.properties?rev=781562&r1=781561&r2=781562&view=diff ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/LocalStrings.properties Wed Jun 3 21:24:27 2009 @@ -82,6 +82,7 @@ standardContext.listenerStart=Exception sending context initialized event to listener instance of class {0} standardContext.listenerStartFailed=Failed to start application Listeners successfully standardContext.listenerStop=Exception sending context destroyed event to listener instance of class {0} +standardContext.listenerStopLogFail=Exception logging to application log whilst sending context destroyed event to listener instance of class {0}. Failure will be logged to container log. standardContext.loginConfig.errorPage=Form error page {0} must start with a ''/' standardContext.loginConfig.errorWarning=WARNING: Form error page {0} must start with a ''/'' in Servlet 2.4 standardContext.loginConfig.loginPage=Form login page {0} must start with a ''/' Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java?rev=781562&r1=781561&r2=781562&view=diff ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java Wed Jun 3 21:24:27 2009 @@ -3806,9 +3806,18 @@ fireContainerEvent("afterContextDestroyed", listener); } catch (Throwable t) { fireContainerEvent("afterContextDestroyed", listener); - getLogger().error - (sm.getString("standardContext.listenerStop", + try { + // This may fail if undeployment was triggered by deletion + // of base directory - bug 37498 + getLogger().error + (sm.getString("standardContext.listenerStop", listeners[j].getClass().getName()), t); + } catch (Throwable t2) { + log.warn(sm.getString("standardContext.listenerStopLogFail", + listeners[j].getClass().getName()), t2); + log.error(sm.getString("standardContext.listenerStop", + listeners[j].getClass().getName()), t); + } ok = false; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org