tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Scheuerer <tabalo...@hispeed.ch>
Subject cannot get Filters to work with Tomcat 5.0.16
Date Tue, 06 Jan 2004 15:28:42 GMT
Hi,

I cannot get Filters to work with Tomcat 5.0.16.

Here are my filter definitions in web.xml:
<filter>
     <filter-name>UserFilter</filter-name>
     <filter-class>ch.ctc.support.common.UserFilter</filter-class>
</filter>

<filter>
     <filter-name>AdminFilter</filter-name>
     <filter-class>ch.ctc.support.common.AdminFilter</filter-class>
</filter>

<filter-mapping>
     <filter-name>UserFilter</filter-name>
     <servlet-name>/*</servlet-name>
</filter-mapping>

<filter-mapping>
     <filter-name>AdminFilter</filter-name>
     <url-pattern>/admin/*</url-pattern>
</filter-mapping>

Every time Tomcat tries to start the context I get the following exception:

java.lang.IllegalArgumentException: Filter mapping must specify either a 
<url-pattern> or a <servlet-name>
     at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
     at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
     at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
     at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
     at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
     at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown

Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at org.apache.commons.digester.Digester.parse(Digester.java:1548)
     at 
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:302)
     at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:644)
     at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:254)
     at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4212)
     at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
     at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:316)
     at org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
     at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:723)
     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393)
     at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
     at org.apache.catalina.core.StandardService.start(StandardService.java:519)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
     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:324)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)

What the hell is going on here? I DID specify a <url-pattern>!  What am I doing 
wrong? Any help would be highly appreciated!

Thanks,
Patrick




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message