This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 6b37f1d732 Follow-on to "Skip parsing a context configuration file ..."
6b37f1d732 is described below
commit 6b37f1d732603035a5252f56466355cf328383a4
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 908754eb72..45ba5a8559 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2072,8 +2072,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]