Bug 49714 - The annotation process of Jar should not impact distributable of web.xml.
The annotation process of Jar should not impact distributable of web.xml.
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
trunk
All All
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-08-05 22:06 UTC by Keiichi Fujino
Modified: 2010-08-05 22:23 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2010-08-05 22:06:15 UTC
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.
Comment 1 Keiichi Fujino 2010-08-05 22:23:16 UTC
Fixed in trunk.
This fix applied to 7.0, will be in 7.0.3 onwards.