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

JAXP FactoryFinder fails to locate provider

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: v3.1
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:

      Description

      [Filing on bahalf of ###@###.###, as he does not have bugster write access]

      JAXP FactoryFinder in JRE makes incorrect assumption about class loaders and throws ClassCastException in OSGi environment. See https://glassfish.dev.java.net/issues/show_bug.cgi?id=11860 for details.

      JRE has javax.xml.stream.XMLInputFactory.class and a default implementation of this service class. Woodstox bundle has javax.xml.stream.XMLInputFactory.class and a default implementation. For whatever reason, woodstox does not use javax.xml.stream.XMLInputFactory.class from JRE, instead, it loads from its own bundle (Please note, boot delegation is not the default in OSGi environment).

      User is using XMLInputFactory from JRE. Now, XMLInputFactory.newFactory (or an equivalent method) is called by user. For whatever reason, if it finds META-INF/service file in woodstox bundle, it will try to instantiate the woodstox provider and return it, but since woodstox uses its own StAX APIs, it results in a ClassCastException.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              joehw Joe Wang
              Reporter:
              jaramu Jagadish Ramu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: