Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4676250

unable to load non-default parser factories from less-privileged code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.2
    • 1.4.1
    • xml
    • 1.2.2
    • generic
    • solaris_2.6

      Less-privileged code (e.g. EJB components running in a J2EE container)
      that does not have file read permissions cannot load a non-default
      parser factory.
      E.g. the Xerces2 implementations of SAXParserFactory and DocumentBuilderFactory are not loaded even when the JRE_HOME/lib/jaxp.properties file contains
      the correct factory classnames as specified in the JAXP1.1 spec.

      This means that EJB components cannot use the Xerces2 parser.

      To reproduce:
      1. Write an EJB class which gets a SAXParserFactory instance and prints its
         classname.
      2. In JRE_HOME/lib/jaxp.properties add a line
        javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
      3. Deploy the EJB and run it: the SAXParserFactory implementation printed is
         org.apache.crimson.jaxp.SAXParserFactoryImpl"

            gsharmasunw Gopal Sharma (Inactive)
            skrishnasunw Sanjeev Krishnan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: