Hi, all.
I tried to use jetty 9 as lightweight container to make project for bug reproducion in IDE and found that jetty fails to deploy web application where servlet-mapping and/or filter-mapping for servlet/filter defined in web-fragment.xml are overriden in web.xml and servlet/filter aren't redefined in web.xml (so servlet/filter definition is only present in web-fragmanet.xml).
I haven't found any information that servlet/filter should be defined both in web-fragment.xml and in web.xml if I want to override servlet/filter-mapping. It may be defined in both files as of servlet 3.0 and 3.1 specifications.
To reproduce:
- unzip archive
- cd idea-127332
- mvn clean install
- cd w2
- mvn jetty:run
Module w1 (without servlet/filter mappings override) deploys to jetty 9 successfully.
Both w1 and w2 can be deployed to tomcat7 (use mvn tomcat7:run) and jboss as 7 (mvn jboss-as:run)
Filters are prepending "filtered\n" to response, servlets return just "ok ,)\n".
Test mappings in w1 (from web-fragment.xml only):
- /w1/s1/* (servlet s1-3)
- /w1/s2/* (servlet s1-3, filter f2)
- /w1/s3/* (servlet s1-3, filter f3)
- /w1/s4 (servlet s4)
Test mappings in w2 (from web-fragment.xml with overrides for web.xml):
- /w2/s1/* (servlet s1-3)
- /w2/s2/* (servlet s1-3, filter f2)
- /w2/s3/* (servlet s1-3, filter f3 with overriden mapping)
- /w2/s4/* (servlet s4 with overriden mapping, filter f3 with overriden mapping)
All mapping in w2 works as expected in tomcat 7.0 and jboss as 7.1.
Environment:
linux, jdk7u60, maven 3.2.2, jetty-maven-plugin 9.2.1.v20140609
--
Best regards,
Konstantin Gribov.