Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-2224

Add a geronimo specific system property for controlling dom, sax, and transformer creation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1
    • 1.1.2, 1.2
    • core
    • Security Level: public (Regular issues)
    • None
    • Patch Available

    Description

      It is common for poorly coded application to set the javax.xml.parsers.DocumentBuilderFactory, javax.xml.parsers.SAXParserFactory, or javax.xml.transform.TransformerFactory properties directly. If the value of these system properties do not point to a modern xml parser such as xerces, critical Geronimo services such as the LocalAttributeManager will stop working. This due to only modern parsers supporting the setAttribute method on the factory (specifically crimson throws an exception).

      The attached patch redirects all call to DocumentBuilderFactory.newInstance(), SAXParserFactory.newInstance() and TransformerFactory.newInstance() to a Geronimo XmlUtil class. This class checks the property geronimo.xml.parsers.DocumentBuilderFactory, geronimo.xml.parsers.SAXParserFactory, or geronimo.xml.transform.TransformerFactor, and if present creates that factory. Otherwise the code simply delegates to the default newInstance implementation.

      Once this patch has been committed the server can be launched with a full xml factory declaration using the following command:

      java \
      -Dgeronimo.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \
      -Dgeronimo.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \
      -Dgeronimo.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl \
      -jar bin/server.jar

      • This patch includes a test case for the new functionality.
      • This patch includes two new classes which must be svn added.

      Attachments

        1. factory.patch
          35 kB
          Dain Sundstrom

        Activity

          People

            dain Dain Sundstrom
            dain Dain Sundstrom
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: