https://issues.apache.org/bugzilla/show_bug.cgi?id=50597

--- Comment #1 from Ismael Juma <mli...@juma.me.uk> 2011-01-16 12:27:26 EST ---
The simple patch that fixes it for me is:


[ijuma@localhost]~/src/tomcat% svn diff
Index: java/org/apache/catalina/core/ApplicationFilterConfig.java
===================================================================
--- java/org/apache/catalina/core/ApplicationFilterConfig.java    (revision
1059421)
+++ java/org/apache/catalina/core/ApplicationFilterConfig.java    (working
copy)
@@ -367,10 +367,10 @@
             this.filter = null;

         } else {
-
-            // Allocate a new filter instance
-            getFilter();
-
+            if (filterDef.getFilter() == null) {
+              // Allocate a new filter instance
+              getFilter();
+            }
         }

     }

I don't know if this is the best way, but it works because after returning from
that method the following is executed in the constructor (which is the same
that getFilter does for the case where Tomcat has the class but not the
instance of Filter):

        if (filterDef.getFilter() != null) {
            this.filter = filterDef.getFilter();
            getInstanceManager().newInstance(filter);
            initFilter();
        }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to