Uploaded image for project: 'JBoss Modules'
  1. JBoss Modules
  2. MODULES-248

Redirecting XMLReaderFactory can lead to ClassNotFoundException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.6.0.Beta1
    • None
    • JAXP Redirection
    • None

      XMLReaderFactory uses static fields for tracking if jar files on the class path were already scanned. When some jar file provides org.xml.sax.driver, it doesn't scan jars in the future and uses class already found. However, __XMLReaderFactory switches class loader before creating XMLReader, which can result into ClassNotFoundException when class providing org.xml.sax.driver is not present in the other class loader.

      Tracking fields in XMLReaderFactory should be probably reset once class loader is switched and when switched back.

      I'm hitting this issue when using wildfly maven plugin together with some other plugin which contains xercex dependency, xml-maven-plugin in my case.

              dlloyd@redhat.com David Lloyd
              vjuranek@redhat.com Vojtech Juranek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: