Hi!

I was reviewing Mark's comment in
https://issues.apache.org/bugzilla/show_bug.cgi?id=33405#c1

1)
> A mal-formed web.xml is ignored

It is ignored in TC7, but it causes the app startup to fail in TC5.5 and TC6.

I think in TC7 the app startup should fail as well,
because there might be security constraints there which won't be
enforced if we ignore the file.

To reproduce:
1. start TC7
2. edit webapps/examples/WEB-INF/web.xml   s/web-app/we b-app/
3. parsing errors are logged, but the app is still available for requests

Do we agree that it is a bug?

A patch might look like the following:
[[[
Index: java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- java/org/apache/catalina/startup/ContextConfig.java (revision 1074853)
+++ java/org/apache/catalina/startup/ContextConfig.java (working copy)
@@ -1222,8 +1222,12 @@
                 orderedFragments = WebXml.orderWebFragments(webXml, fragments);

                 // Step 3. Look for ServletContainerInitializer implementations
-                ok = processServletContainerInitializers(orderedFragments);
-
+                if (ok) {
+                  if (!processServletContainerInitializers(orderedFragments)) {
+                      ok = false;
+                  }
+                }
+
                 // Step 4. Process /WEB-INF/classes for annotations
                 // This will add any matching classes to the typeInitializerMap
                 if (ok) {
@@ -1274,7 +1278,6 @@
                 }
             } else {
                 webXml.configureContext(context);
-                ok = true;
             }

             // Always need to look for static resources

]]]

2) I think that some values returned by LifecycleState#isAvailable() are wrong.
-> created https://issues.apache.org/bugzilla/show_bug.cgi?id=50836


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to