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

Bug in XPathFactory.newInstance() method

    XMLWordPrintable

Details

    • 1.4
    • x86
    • linux, windows_xp

    Backports

      Description

        FULL PRODUCT VERSION :
        5.0 update 2 and all earlier releases

        ADDITIONAL OS VERSION INFORMATION :
        All OSes (bug in Java code)

        A DESCRIPTION OF THE PROBLEM :
        The XPathFactory.newInstance() method never looks for the META-INF/services/javax.xml.xpath.XPathFactory properties file in the Thread's context class loader, but ALWAYS uses the system one. The following patch fixes the problem:

        diff -U3 -r src/javax/xml/xpath/SecuritySupport.java srcx/javax/xml/xpath/SecuritySupport.java
        --- src/javax/xml/xpath/SecuritySupport.java Fri Mar 4 00:26:36 2005
        +++ srcx/javax/xml/xpath/SecuritySupport.java Tue Apr 12 23:17:02 2005
        @@ -103,7 +103,7 @@
                             if (cl == null) {
                                 enumeration = ClassLoader.getSystemResources(name);
                             } else {
        - enumeration = cl.getSystemResources(name);
        + enumeration = cl.getResources(name);
                             }
                             return enumeration;
                         }



        REPRODUCIBILITY :
        This bug can be reproduced often.

        CUSTOMER SUBMITTED WORKAROUND :
        Apply this patch:

        diff -U3 -r src/javax/xml/xpath/SecuritySupport.java srcx/javax/xml/xpath/SecuritySupport.java
        --- src/javax/xml/xpath/SecuritySupport.java Fri Mar 4 00:26:36 2005
        +++ srcx/javax/xml/xpath/SecuritySupport.java Tue Apr 12 23:17:02 2005
        @@ -103,7 +103,7 @@
                             if (cl == null) {
                                 enumeration = ClassLoader.getSystemResources(name);
                             } else {
        - enumeration = cl.getSystemResources(name);
        + enumeration = cl.getResources(name);
                             }
                             return enumeration;
                         }

        Attachments

          Issue Links

            Activity

              People

                jsuttorsunw Jeff Suttor (Inactive)
                gmanwanisunw Girish Manwani (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: