I have run into some problems with the Xerces library, which is used by a third party lib that I rely on.
Xerces does not support JAXP 1.5, yet, which is contained in recent releases of JDK 1.7 and JDK 8. This leads to some problems, if Xerces is used as the XML parser, which can happen when several XML parsers are known to the system. Removing xercesImpl-v2.9.0.jar
immediately fixes the problem, but then the 3rd party library isn't working anymore.
I can see two solutions to the problem:
It seems that the only bit from the Xerces library that is actually used is the
org.apache.xerces.util.XMLCatalogResolver
, used inCustomResolver.java
. Are there other options for the catalog resolver instead of the Xerces one?Another option seems to be to explicitly set the system properties for XML parsing at JVM launch. That way the JVM can told which XML parser to use and it wouldn't select Xerces anymore.
I found the following three properties:
-Djavax.xml.transform.TransformerFactory
-Djavax.xml.parsers.SAXParserFactory
-Djavax.xml.parsers.DocumentBuilderFactory
This leads to two questions, though:
- Are these three properties the only system properties that need to be set in order to redirect the JVM to a specific XML parser?
- Could setting the properties explicitly have any side effects?