This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new b2316a1e68 Follow-on to "Skip parsing a context configuration file ..."
b2316a1e68 is described below
commit b2316a1e6852e4d35accc8fab69ed67a92df6422
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Oct 19 20:26:52 2026 +0100
Follow-on to "Skip parsing a context configuration file ..."
Fix the same problem parsing web.xml files
---
java/org/apache/catalina/startup/ContextConfig.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/startup/ContextConfig.java
b/java/org/apache/catalina/startup/ContextConfig.java
index b09728b454..66aa5f9319 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2068,8 +2068,12 @@ public class ContextConfig implements LifecycleListener {
try {
stream = webXmlResource.getInputStream();
- source = new InputSource(webXmlResource.getURI().toString());
if (stream != null) {
+ // Only create the input source if the stream is available so
+ // that a source without a byte stream is never returned. The
+ // parser would otherwise try to resolve the URI itself and
+ // report the same problem a second time.
+ source = new InputSource(webXmlResource.getURI().toString());
source.setByteStream(stream);
}
} catch (Exception e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]