Author: remy.maucherat(a)jboss.com
Date: 2012-11-21 04:54:34 -0500 (Wed, 21 Nov 2012)
New Revision: 2129
Modified:
branches/7.2.x/src/main/java/org/apache/catalina/core/ApplicationFilterConfig.java
branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java
branches/7.2.x/src/main/java/org/jboss/web/CatalinaMessages.java
branches/7.2.x/webapps/docs/changelog.xml
Log:
Harmonize with other components: catch exceptions on filter destroy.
Modified:
branches/7.2.x/src/main/java/org/apache/catalina/core/ApplicationFilterConfig.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/catalina/core/ApplicationFilterConfig.java 2012-11-19
18:28:07 UTC (rev 2128)
+++
branches/7.2.x/src/main/java/org/apache/catalina/core/ApplicationFilterConfig.java 2012-11-21
09:54:34 UTC (rev 2129)
@@ -462,15 +462,15 @@
if (this.filter != null)
{
- if (Globals.IS_SECURITY_ENABLED) {
- try {
+ try {
+ if (Globals.IS_SECURITY_ENABLED) {
SecurityUtil.doAsPrivilege("destroy", filter);
- } catch(java.lang.Exception ex){
- context.getLogger().error(MESSAGES.doAsPrivilegeException(), ex);
+ SecurityUtil.remove(filter);
+ } else {
+ filter.destroy();
}
- SecurityUtil.remove(filter);
- } else {
- filter.destroy();
+ } catch(java.lang.Exception ex){
+
context.getLogger().error(MESSAGES.errorDestroyingFilter(getFilterName()), ex);
}
try {
((StandardContext)
context).getInstanceManager().destroyInstance(this.filter);
Modified: branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java 2012-11-19
18:28:07 UTC (rev 2128)
+++ branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java 2012-11-21
09:54:34 UTC (rev 2129)
@@ -3244,16 +3244,22 @@
protected boolean filterStop() {
// Release all Filter and FilterConfig instances
+ boolean ok = true;
Iterator<String> names = filterConfigs.keySet().iterator();
while (names.hasNext()) {
String name = names.next();
CatalinaLogger.CORE_LOGGER.stoppingFilter(name);
ApplicationFilterConfig filterConfig =
(ApplicationFilterConfig) filterConfigs.get(name);
- filterConfig.release();
+ try {
+ filterConfig.release();
+ } catch (Throwable t) {
+ getLogger().error(MESSAGES.errorStoppingFilter(name), t);
+ ok = false;
+ }
}
filterConfigs.clear();
- return (true);
+ return (ok);
}
Modified: branches/7.2.x/src/main/java/org/jboss/web/CatalinaMessages.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/CatalinaMessages.java 2012-11-19 18:28:07
UTC (rev 2128)
+++ branches/7.2.x/src/main/java/org/jboss/web/CatalinaMessages.java 2012-11-21 09:54:34
UTC (rev 2129)
@@ -627,8 +627,8 @@
@Message(id = 244, value = "Illegal null or empty argument specified")
IllegalArgumentException invalidServletRegistrationArguments();
- @Message(id = 245, value = "Priveleged action exception")
- String doAsPrivilegeException();
+ @Message(id = 245, value = "Error destroying filter %s")
+ String errorDestroyingFilter(String filterName);
@Message(id = 246, value = "Exception processing component pre destroy")
String preDestroyException();
@@ -969,4 +969,7 @@
@Message(id = 358, value = "Message digest non initialized")
IllegalStateException uninitializedMessageDigest();
+ @Message(id = 359, value = "Exception releasing filter %s")
+ String errorStoppingFilter(String filterName);
+
}
Modified: branches/7.2.x/webapps/docs/changelog.xml
===================================================================
--- branches/7.2.x/webapps/docs/changelog.xml 2012-11-19 18:28:07 UTC (rev 2128)
+++ branches/7.2.x/webapps/docs/changelog.xml 2012-11-21 09:54:34 UTC (rev 2129)
@@ -17,6 +17,13 @@
<body>
<section name="JBoss Web 7.2.0.Alpha4 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ Catch filter destroy errors. (remm)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Coyote">
<changelog>
<fix>
Show replies by date