Community
Participate
Working Groups
Build Identifier: 7.2.0.v20101020 Looking at JMX output in JConsole, I noticed that the web app context seems to be duplicating servlet mappings after a restart. Running dump() just after the server has started shows this partial output: ... +-SessionHandler@3e4a9a7d started +-ConstraintSecurityHandler@6b754699 started +-[] +-/={TRACE={RoleInfo,F,C[]}} +-ServletHandler@13a78071 started +-[/]=>default{...} +-[*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, .XSP]=>jsp{...} ... After a restart, dump() returns: +-SessionHandler@3e4a9a7d started +-ConstraintSecurityHandler@6b754699 started +-[] +-/={TRACE={RoleInfo,F,C[]}} +-ServletHandler@13a78071 started +-[/]=>default{...} +-[*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp{...} +-[/]=>default{...} +-[*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp{...} Notice the servlet mappings are duplicated. If the webapp is reloaded again, there are 3 mappings for each servlet. Further investigation shows that the following line in WebXmlConfiguration.configure() is to blame: context.getMetaData().addDescriptorProcessor(new StandardDescriptorProcessor()); Each time the app is configured (reloaded), it will add a new StandardDescriptorProcessor(). This processor is not removed in deconfigure(), so the web.xml files are processed multiple times. Logic in other classes makes sure that the actual servlets are not loaded multiple times which is probably why this bug is not immediately apparent. Reproducible: Always Steps to Reproduce: 1. Create a webapp with at least 1 servlet mapping 2. Call webapp.dump() 3. Reload the webapp without stopping the server 4. Rerun webapp.dump()
Fixed in trunk rev 2529.