Apache Tomcat Maven Plugin
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-128

The plugin ignores and/or parses web.xml incorrectally when using tomcatWebXml option


    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.1
    • Component/s: tomcat6, tomcat7
    • Labels:
    • Environment:
      openSUSE 12.1 32Bits


      In our project(jpa-spring-wicket) we need to filter the web.xml file, changing some placeholder and putting it (the web.xml) in $

      Using tomcat6-maven-plugin it find the correct file, but fail when parsing it:
      Caused by: java.lang.IllegalArgumentException: Duplicate context initialization parameter contextConfigLocation
      at org.apache.catalina.core.StandardContext.addParameter(StandardContext.java:2661)
      ... 52 more
      Mar 16, 2012 11:49:12 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
      SEVERE: Parse error in application web.xml file at jndi:/localhost/a2p/WEB-INF/web.xml
      org.xml.sax.SAXParseException; systemId: jndi:/localhost/a2p/WEB-INF/web.xml; lineNumber: 15; columnNumber: 21; Error at (15, 21: Duplicate context initialization parameter contextConfigLocation
      at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2806)

      Using tomcat7-maven-plugin it find the correct file, but ignores it so using the original file which contain the ${placeholder}. Thus not initializing the application:
      INFO - ContextLoader - Root WebApplicationContext: initialization completed in 7808 ms
      INFO - WebXmlFile - web.xml: url mapping found for filter with name A2P: [/*]
      Mar 16, 2012 12:08:16 PM org.apache.catalina.core.StandardContext filterStart
      SEVERE: Exception starting filter A2P
      java.lang.IllegalArgumentException: Invalid configuration type: '${wicket.MODE}'. Must be "development" or "deployment".
      at org.apache.wicket.protocol.http.WebApplication.getConfigurationType(WebApplication.java:670)
      at org.apache.wicket.Application.configure(Application.java:297)
      at org.apache.wicket.protocol.http.WebApplication.internalInit(WebApplication.java:613)
      at org.apache.wicket.Application.initApplication(Application.java:806)
      at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:346)
      at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:286)
      at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)


      The plugin configuration:




      I have the jetty plugin setup as well and working, so I would try with tomcat but without success until now.

      1. myproject.zip
        24 kB
        Gilberto C Andrade


        No work has yet been logged on this issue.


          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Gilberto C Andrade
          • Votes:
            0 Vote for this issue
            4 Start watching this issue


            • Created: