Can I use a Generic SAX/DOM XML parser for Tomcat instead of parser.jar? I tried using Xerces and get class not found errors for sun.xxxx parser during Tomcat initialization.
Created May 4, 2012
Luigi Viggiano Try to configure Xerces as customized SAX/DOM implementation by system properties.
By default jaxp uses com.sun.xml.parser.DocumentBuilderFactoryImpl and com.sun.xml.parser.SAXParserFactoryImpl (this is why you get ClassNotFoundException if you miss parser.jar from the classpath).
Example:
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");