Author: markt
Date: Mon Jul 11 13:05:30 2011
New Revision: 1145160
URL: http://svn.apache.org/viewvc?rev=1145160&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51494
Prevent an NPE when a long running request completes if the associated web
application was destroyed while the request was processing
Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java?rev=1145160&r1=1145159&r2=1145160&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java Mon
Jul 11 13:05:30 2011
@@ -180,7 +180,12 @@ final class StandardContextValve
// place
if (!(request.isAsync() || (asyncAtStart && request.getAttribute(
RequestDispatcher.ERROR_EXCEPTION) != null))) {
- context.fireRequestDestroyEvent(request);
+ // Protect against NPEs if context was destroyed during a long
+ // running request.
+ StandardContext c = context;
+ if (c != null && c.getState().isAvailable()) {
+ context.fireRequestDestroyEvent(request);
+ }
}
}
}
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1145160&r1=1145159&r2=1145160&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jul 11 13:05:30 2011
@@ -62,6 +62,11 @@
<fix>
Fix regression in year number formatting for AccessLogValve. (rjung)
</fix>
+ <fix>
+ <bug>51494</bug>: Prevent an NPE when a long running request completes
+ if the associated web application was destroyed while the request was
+ processing. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]