Re: svn commit: r1006033 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml

2010-10-09 Thread Sylvain Laurent
This commit broke all default webapps (ROOT, examples, docs). a 404 is returned 
instead...


On 8 oct. 2010, at 23:37, ma...@apache.org wrote:

 Author: markt
 Date: Fri Oct  8 21:37:19 2010
 New Revision: 1006033
 
 URL: http://svn.apache.org/viewvc?rev=1006033view=rev
 Log:
 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50059
 Always make JAR resources available
 
 Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/webapps/docs/changelog.xml
 
 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=1006033r1=1006032r2=1006033view=diff
 ==
 --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java 
 (original)
 +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Oct  
 8 21:37:19 2010
 @@ -1214,7 +1214,7 @@ public class ContextConfig
 webXmlVersion = Double.parseDouble(webXml.getVersion());
 }
 
 -if (webXmlVersion = 3  !webXml.isMetadataComplete()) {
 +if (webXmlVersion = 3) {
 // Ordering is important here
 
 // Step 1. Identify all the JARs packaged with the application
 @@ -1222,67 +1222,78 @@ public class ContextConfig
 // point.
 MapString,WebXml fragments = processJarsForWebFragments();
 
 -// Step 2. Order the fragments.
 -SetWebXml orderedFragments =
 -WebXml.orderWebFragments(webXml, fragments);
 -
 -// Step 3. Look for ServletContainerInitializer implementations
 -ok = processServletContainerInitializers(orderedFragments);
 -
 -// Step 4. Process /WEB-INF/classes for annotations
 -// This will add any matching classes to the typeInitializerMap
 -if (ok) {
 -URL webinfClasses;
 -try {
 -webinfClasses =
 -
 context.getServletContext().getResource(/WEB-INF/classes);
 -processAnnotationsUrl(webinfClasses, webXml);
 -} catch (MalformedURLException e) {
 -
 log.error(sm.getString(contextConfig.webinfClassesUrl), e);
 +// Only need to process fragments and annotations if metadata is
 +// not complete
 +SetWebXml orderedFragments = null;
 +if  (!webXml.isMetadataComplete()) {
 +// Step 2. Order the fragments.
 +orderedFragments = WebXml.orderWebFragments(webXml, 
 fragments);
 +
 +// Step 3. Look for ServletContainerInitializer 
 implementations
 +ok = processServletContainerInitializers(orderedFragments);
 +
 +// Step 4. Process /WEB-INF/classes for annotations
 +// This will add any matching classes to the 
 typeInitializerMap
 +if (ok) {
 +URL webinfClasses;
 +try {
 +webinfClasses = 
 context.getServletContext().getResource(
 +/WEB-INF/classes);
 +processAnnotationsUrl(webinfClasses, webXml);
 +} catch (MalformedURLException e) {
 +log.error(sm.getString(
 +contextConfig.webinfClassesUrl), e);
 +}
 }
 -}
 -
 -// Step 5. Process JARs for annotations - only need to process 
 those
 -// fragments we are going to use
 -// This will add any matching classes to the typeInitializerMap
 -if (ok) {
 -processAnnotations(orderedFragments);
 -}
 -
 -// Step 6. Merge web-fragment.xml files into the main web.xml 
 file.
 -if (ok) {
 -ok = webXml.merge(orderedFragments);
 -}
 -
 -// Step 6.5 Convert explicitly mentioned jsps to servlets
 -if (!false) {
 -convertJsps(webXml);
 -}
 -
 -// Step 7. Apply merged web.xml to Context
 -if (ok) {
 -webXml.configureContext(context);
 -
 -// Step 7a. Make the merged web.xml available to other
 -// components, specifically Jasper, to save those components
 -// from having to re-generate it.
 -// TODO Use a ServletContainerInitializer for Jasper
 -String mergedWebXml = webXml.toXml();
 -context.getServletContext().setAttribute(
 -   org.apache.tomcat.util.scan.Constants.MERGED_WEB_XML,
 -mergedWebXml);
 -if (context.getLogEffectiveWebXml()) {
 -log.info(web.xml:\n + mergedWebXml);
 +
 

svn commit: r1006033 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml

2010-10-08 Thread markt
Author: markt
Date: Fri Oct  8 21:37:19 2010
New Revision: 1006033

URL: http://svn.apache.org/viewvc?rev=1006033view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50059
Always make JAR resources available

Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/webapps/docs/changelog.xml

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=1006033r1=1006032r2=1006033view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Oct  8 
21:37:19 2010
@@ -1214,7 +1214,7 @@ public class ContextConfig
 webXmlVersion = Double.parseDouble(webXml.getVersion());
 }
 
-if (webXmlVersion = 3  !webXml.isMetadataComplete()) {
+if (webXmlVersion = 3) {
 // Ordering is important here
 
 // Step 1. Identify all the JARs packaged with the application
@@ -1222,67 +1222,78 @@ public class ContextConfig
 // point.
 MapString,WebXml fragments = processJarsForWebFragments();
 
-// Step 2. Order the fragments.
-SetWebXml orderedFragments =
-WebXml.orderWebFragments(webXml, fragments);
-
-// Step 3. Look for ServletContainerInitializer implementations
-ok = processServletContainerInitializers(orderedFragments);
-
-// Step 4. Process /WEB-INF/classes for annotations
-// This will add any matching classes to the typeInitializerMap
-if (ok) {
-URL webinfClasses;
-try {
-webinfClasses =
-
context.getServletContext().getResource(/WEB-INF/classes);
-processAnnotationsUrl(webinfClasses, webXml);
-} catch (MalformedURLException e) {
-log.error(sm.getString(contextConfig.webinfClassesUrl), 
e);
+// Only need to process fragments and annotations if metadata is
+// not complete
+SetWebXml orderedFragments = null;
+if  (!webXml.isMetadataComplete()) {
+// Step 2. Order the fragments.
+orderedFragments = WebXml.orderWebFragments(webXml, fragments);
+
+// Step 3. Look for ServletContainerInitializer implementations
+ok = processServletContainerInitializers(orderedFragments);
+
+// Step 4. Process /WEB-INF/classes for annotations
+// This will add any matching classes to the typeInitializerMap
+if (ok) {
+URL webinfClasses;
+try {
+webinfClasses = 
context.getServletContext().getResource(
+/WEB-INF/classes);
+processAnnotationsUrl(webinfClasses, webXml);
+} catch (MalformedURLException e) {
+log.error(sm.getString(
+contextConfig.webinfClassesUrl), e);
+}
 }
-}
-
-// Step 5. Process JARs for annotations - only need to process 
those
-// fragments we are going to use
-// This will add any matching classes to the typeInitializerMap
-if (ok) {
-processAnnotations(orderedFragments);
-}
-
-// Step 6. Merge web-fragment.xml files into the main web.xml file.
-if (ok) {
-ok = webXml.merge(orderedFragments);
-}
-
-// Step 6.5 Convert explicitly mentioned jsps to servlets
-if (!false) {
-convertJsps(webXml);
-}
-
-// Step 7. Apply merged web.xml to Context
-if (ok) {
-webXml.configureContext(context);
-
-// Step 7a. Make the merged web.xml available to other
-// components, specifically Jasper, to save those components
-// from having to re-generate it.
-// TODO Use a ServletContainerInitializer for Jasper
-String mergedWebXml = webXml.toXml();
-context.getServletContext().setAttribute(
-   org.apache.tomcat.util.scan.Constants.MERGED_WEB_XML,
-mergedWebXml);
-if (context.getLogEffectiveWebXml()) {
-log.info(web.xml:\n + mergedWebXml);
+
+// Step 5. Process JARs for annotations - only need to process
+// those fragments we are going to use
+// This will add any matching classes to the typeInitializerMap
+if (ok) {
+