DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43338>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43338

           Summary: Setting '*' as the servlet-name in filter-mapping causes
                    IllegalArgumentException.
           Product: Tomcat 6
           Version: 6.0.14
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


SRV 6.2.5 says supporting for '*' as the servlet-name in filter-mapping.
I set following filter-mapping.
    <filter-mapping>
        <filter-name>SampleFilter</filter-name>
        <servlet-name>*</servlet-name>
    </filter-mapping>

However, InvocationTargetException occurred in Digester. 
It is as follows.

Sep 10, 2007 7:16:56 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tomcat.util.IntrospectionUtils.callMethod1
(IntrospectionUtils.java:899)
        at org.apache.tomcat.util.digester.SetNextRule.end
(SetNextRule.java:193)
        at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
        at org.apache.tomcat.util.digester.Digester.endElement
(Digester.java:1058)
        omit...
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.IllegalArgumentException: Filter mapping must specify 
either a <url-pattern> or a <servlet-name>
        at org.apache.catalina.core.StandardContext.addFilterMap
(StandardContext.java:2160)
        ... 44 more
   omit...


I made a StandardContext's patch.

Index:/tomcat6-trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- /tomcat6-trunk/java/org/apache/catalina/core/StandardContext.java
        (revision 574195)
+++ /tomcat6-trunk/java/org/apache/catalina/core/StandardContext.java
        (working copy)
@@ -2156,7 +2156,9 @@
         if (findFilterDef(filterName) == null)
             throw new IllegalArgumentException
                 (sm.getString("standardContext.filterMap.name", filterName));
-        if ((servletNames.length == 0) && (urlPatterns.length == 0))
+        if (!filterMap.getMatchAllServletNames() && 
+                       !filterMap.getMatchAllUrlPatterns() && 
+                (servletNames.length == 0) && (urlPatterns.length == 0))
             throw new IllegalArgumentException
                 (sm.getString("standardContext.filterMap.either"));
         // FIXME: Older spec revisions may still check this

I made a StandardContext's patch.

Regards.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to