tomcat-users.xml has invalid encoding "cp1252" when using endorsed library xercesImpl.jar when tomcat is run for the first time. (in tomcat.6.0.16 the default encoding for the file was utf-8... now for tomcat.6.0.18 it is cp1252) We have an installation process for our software which: 1. Installs our software 2. Fires up the windows installation for tomcat.6.0.18 3. configures the endorsed java options by modifying the registry setting for tomcat (ie -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 6.0\endorsed) 4. copies the endorsed jar files to the endorsed directory 5. deploys our application's war file to the webapps directory. 6. attempts to start tomcat The generated exception is: INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Mar 25, 2009 4:06:37 PM org.apache.tomcat.util.digester.Digester fatalError SEVERE: Parse Fatal Error at line 1 column 40: Invalid encoding name "cp1252". org.xml.sax.SAXParseException: Invalid encoding name "cp1252". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ... My workaround for this problem is to deploy a copy of tomcat-users.xml file with the encoding set to "utf-8" to the conf directory before tomcat is attempted to be started. (ie between steps 5 and 6 above). Once tomcat is started, this file is overwritten anyway.
The change to cp1252 is as a result of bug 45332. When you use xerces via the endorsed mechanism, the feature http://apache.org/xml/features/allow-java-encodings is false so cp1252 isn't recognised. I'll look at using the IANA names.
A fix has been made in trunk and proposed for 6.0.x. I took a different approach (which will only work with xerces) that tries to configure the xml parser to support the java encoding names.
This has been fixed in 6.0.x and will be included in 6.0.21 onwards.