Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1420

javax.xml.parsers.DocumentBuilderFactory looks first at the ContextClassLoader then Class.forName, but SchemaFactoryFinder does not

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.9.1
    • None
    • None

    Description

      javax.xml.parsers.DocumentBuilderFactory looks first at the ContextClassLoader then Class.forName, but SchemaFactoryFinder does not. This causes problems on OSGi systems and it seems that the two strategies should be consistent. Here is the patch I used.

      diff rc tmp/javax/xml/validation/SchemaFactoryFinder.java xml-commons-external
      1.4.01/javax/xml/validation/SchemaFactoryFinder.java

          • tmp/javax/xml/validation/SchemaFactoryFinder.java 2009-02-16 00:09:32.0000
            00000 +0000
          • xml-commons-external-1.4.01/javax/xml/validation/SchemaFactoryFinder.java201
            0-01-19 12:35:17.685540400 +0000
            ***************
          • 301,307 ****
            if (debug) debugPrintln("instanciating "+className);
            Class clazz;
            if( classLoader!=null )
            ! clazz = classLoader.loadClass(className);
            else
            clazz = Class.forName(className);
            if(debug) debugPrintln("loaded it from "+which(clazz));
          • 301,313 ----
            if (debug) debugPrintln("instanciating "+className);
            Class clazz;
            if( classLoader!=null )
            ! try { ! clazz = classLoader.loadClass(className); ! }

            ! catch (ClassNotFoundException cnfe)

            { ! // fallback ! clazz = Class.forName(className); ! }

            else
            clazz = Class.forName(className);
            if(debug) debugPrintln("loaded it from "+which(clazz));

      Attachments

        Activity

          People

            Unassigned Unassigned
            andypiper Andrew James Piper
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: