Author: markt
Date: Mon Aug 23 19:37:25 2010
New Revision: 988266

URL: http://svn.apache.org/viewvc?rev=988266&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49721
All JARs can be resource JARs. Although the spec defines no order, use ordered 
JARs in order then the remaining JARs in any order.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=988266&r1=988265&r2=988266&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Aug 23 
19:37:25 2010
@@ -37,6 +37,7 @@ import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
@@ -1269,7 +1270,18 @@ public class ContextConfig
             
             // Step 8. Look for static resources packaged in JARs
             if (ok) {
-                processResourceJARs(orderedFragments);
+                // Spec does not define an order.
+                // Use ordered JARs followed by remaining JARs
+                Set<WebXml> resourceJars = new LinkedHashSet<WebXml>();
+                for (WebXml fragment : orderedFragments) {
+                    resourceJars.add(fragment);
+                }
+                for (WebXml fragment : fragments.values()) {
+                    if (!resourceJars.contains(fragment)) {
+                        resourceJars.add(fragment);
+                    }
+                }
+                processResourceJARs(resourceJars);
             }
             
             // Step 9. Apply the ServletContainerInitializer config to the



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to