Project: Tomcat
Bug 49714 The annotation process of Jar should not impact distributable of web.xml.
Reported: 2010-08-05 22:06:15 | Status: resolved fixed

Even if < distributable/> is set to web.xml(servlet3.0), distributable is changed from true to false by the annotation process of JAR. ContextConfig#processAnnotations is as follows. ===ContextConfig#processAnnotations protected void processAnnotations(Set<WebXml> fragments) { for(WebXml fragment : fragments) { if (!fragment.isMetadataComplete()) { WebXml annotations = new WebXml(); URL url = fragment.getURL(); processAnnotationsUrl(url, annotations); Set<WebXml> set = new HashSet<WebXml>(); set.add(annotations); // Merge annotations into fragment - fragment takes priority fragment.merge(set); } } } === distributable of "annotations" created by new WebXml() is false (default). If "annotations" is merged with "fragment", distributable of "fragment" becomes false. Because "fragment" is merged with web.xml of the web application, even if < distributable/> is set to web.xml, distributable is changed from true to false. The following are necessary. annotations.setDistributable(true); Best regards.

Files changed in fix:
java/org/apache/catalina/startup/ContextConfig.java