When reading tomcat-users.xml try to ensure the digester supports the java encoding names. The windows installer will often use these names. The JVM does this by default. If the endorsed mechanism is used, an alternative parser may not support the Java encodings. This fix will only work for xerces.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@758365
13f79535-47bb-0310-9956-
ffa450edef68
memoryRealm.loadExist=Memory database file {0} cannot be read
memoryRealm.loadPath=Loading users from memory database file {0}
memoryRealm.readXml=Exception while reading memory database file
+memoryRealm.xmlFeatureEncoding=Exception configuring digester to permit java encoding names in XML files. Only IANA encoding names will be supported.
realmBase.algorithm=Invalid message digest algorithm {0} specified
realmBase.alreadyStarted=This Realm has already been started
realmBase.digest=Error digesting user credentials
if (digester == null) {
digester = new Digester();
digester.setValidating(false);
+ try {
+ digester.setFeature(
+ "http://apache.org/xml/features/allow-java-encodings",
+ true);
+ } catch (Exception e) {
+ log.warn(sm.getString("memoryRealm.xmlFeatureEncoding"), e);
+ }
digester.addRuleSet(new MemoryRuleSet());
}
return (digester);
memoryUserDatabase.writeException=IOException writing to {0}
memoryUserDatabase.notPersistable=User database is not persistable - no write permissions on directory
memoryUserDatabase.readOnly=User database has been configured to be read only. Changes cannot be saved
+memoryUserDatabase.xmlFeatureEncoding=Exception configuring digester to permit java encoding names in XML files. Only IANA encoding names will be supported.
// Construct a digester to read the XML input file
Digester digester = new Digester();
+ try {
+ digester.setFeature(
+ "http://apache.org/xml/features/allow-java-encodings",
+ true);
+ } catch (Exception e) {
+ log.warn(sm.getString("memoryUserDatabase.xmlFeatureEncoding"), e);
+ }
digester.addFactoryCreate
("tomcat-users/group",
new MemoryGroupCreationFactory(this));