Bug 49714 - The annotation process of Jar should not impact distributable of web.xml.
Summary: The annotation process of Jar should not impact distributable of web.xml.
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
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.