8 Replies Latest reply on Oct 17, 2012 1:45 AM by Andrew Bourgeois

    java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name rememberCookieFilter

    Andrew Bourgeois Newbie

      My web.xml looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

          <!-- Make sure that the rememberCookieFilter is executed before the mustBeSignedInFilter -->

          <filter-mapping>

              <filter-name>rememberCookieFilter</filter-name>

              <url-pattern>/*</url-pattern>

          </filter-mapping>

          <filter-mapping>

              <filter-name>mustBeSignedInFilter</filter-name>

              <url-pattern>/user/*</url-pattern>

          </filter-mapping>

      </web-app>

       

      and my filters are correctly annotated:

       

      @WebFilter(filterName="rememberCookieFilter")

      public class RememberCookieFilter implements Filter

       

      @WebFilter(filterName="mustBeSignedInFilter")

      public class MustBeSignedInFilter implements Filter

       

      I get this error when I try to deploy:

       

      21:10:50,160 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Context [/webapp] startup failed due to previous errors: java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name rememberCookieFilter

                at org.apache.catalina.core.StandardContext.validateFilterMap(StandardContext.java:2040) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:1996) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.JBossContextConfig.processWebMetaData(JBossContextConfig.java:314) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.web.deployment.JBossContextConfig.applicationWebConfig(JBossContextConfig.java:169) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:417) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:182) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:162) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3790) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]

       

      Tomcat had a very similar issue a few months ago:

      http://stackoverflow.com/questions/10856866/using-tomcat-webfilter-doesnt-work-with-filter-mapping-inside-web-xml

       

      My webapp works on the latest Tomcat (they fixed the issue), and it works on OpenShift (using the JBoss AS 7.1 cartdridge), but not on my local JBoss AS 7.1 installation....