This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 76da8de Fix Tomcat start when XML parser does not support allow-java-encodings 76da8de is described below commit 76da8deac37071e8a891580d74ba1322c7a2da2c Author: Mark Thomas <ma...@apache.org> AuthorDate: Sat Aug 7 15:42:48 2021 +0200 Fix Tomcat start when XML parser does not support allow-java-encodings --- .../catalina/authenticator/jaspic/LocalStrings.properties | 1 + .../jaspic/PersistentProviderRegistrations.java | 14 +++++++++----- webapps/docs/changelog.xml | 9 +++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties index b86acb1..5d7e376 100644 --- a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties +++ b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties @@ -28,5 +28,6 @@ jaspicAuthenticator.authenticate=Authenticating request for [{0}] via JASPIC persistentProviderRegistrations.deleteFail=The temporary file [{0}] cannot be deleted persistentProviderRegistrations.existsDeleteFail=The temporary file [{0}] already exists and cannot be deleted persistentProviderRegistrations.moveFail=Failed to move [{0}] to [{1}] +persistentProviderRegistrations.xmlFeatureEncoding=Exception configuring JASPIC to permit java encoding names in XML configuration files. Only IANA encoding names will be supported. simpleServerAuthConfig.noModules="No ServerAuthModules configured" diff --git a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java index 8ffe8ec..b533105 100644 --- a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java +++ b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java @@ -31,6 +31,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import javax.xml.parsers.ParserConfigurationException; + import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.digester.Digester; @@ -43,6 +45,7 @@ import org.xml.sax.SAXException; */ public final class PersistentProviderRegistrations { + private static final Log log = LogFactory.getLog(PersistentProviderRegistrations.class); private static final StringManager sm = StringManager.getManager(PersistentProviderRegistrations.class); @@ -59,12 +62,13 @@ public final class PersistentProviderRegistrations { try { digester.setFeature("http://apache.org/xml/features/allow-java-encodings", true); - digester.setValidating(true); - digester.setNamespaceAware(true); - } catch (Exception e) { - throw new SecurityException(e); + } catch (SAXException se) { + log.warn(sm.getString("persistentProviderRegistrations.xmlFeatureEncoding"), se); } + digester.setValidating(true); + digester.setNamespaceAware(true); + // Create an object to hold the parse results and put it on the top // of the digester's stack Providers result = new Providers(); @@ -83,7 +87,7 @@ public final class PersistentProviderRegistrations { digester.parse(is); return result; - } catch (IOException | SAXException e) { + } catch (IOException | ParserConfigurationException | SAXException e) { throw new SecurityException(e); } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index d8b382d..b29ecfd 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -105,6 +105,15 @@ issues do not "pop up" wrt. others). --> <section name="Tomcat 10.1.0-M5 (markt)" rtext="in development"> + <subsection name="Catalina"> + <changelog> + <fix> + Enable Tomcat to start if an (old) XML parser is configured that does + not support <code>allow-java-encodings</code>. A warning will be logged + if such an XML parser is detected. (markt) + </fix> + </changelog> + </subsection> <subsection name="Coyote"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org