Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5756

If metadata-complete not specified, filter-mappping fail

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 7.1.1.Final
    • None
    • None

    Description

      web.xml:

      <?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>

      Annotated filters:

      @WebFilter(filterName="rememberCookieFilter")
      public class RememberCookieFilter implements Filter

      @WebFilter(filterName="mustBeSignedInFilter")
      public class MustBeSignedInFilter implements Filter

      Output when deploying:

      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]

      The issue disappears when you add "metadata-complete="false"", which should be exactly the same as not specifying the attribute.

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrew.bourgeois@demmel.be Andrew Bourgeois (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: