Browse Source

HADOOP-5254. The Configuration class should be able to work with XML
parsers that do not support xmlinclude. (Steve Loughran via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@745269 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 16 years ago
parent
commit
3ef44d4d14
2 changed files with 11 additions and 1 deletions
  1. 3 0
      CHANGES.txt
  2. 8 1
      src/core/org/apache/hadoop/conf/Configuration.java

+ 3 - 0
CHANGES.txt

@@ -604,6 +604,9 @@ Release 0.20.0 - Unreleased
     HADOOP-5211. Fix check for job completion in TestSetupAndCleanupFailure.
     (enis)
 
+    HADOOP-5254. The Configuration class should be able to work with XML
+    parsers that do not support xmlinclude. (Steve Loughran via dhruba)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

+ 8 - 1
src/core/org/apache/hadoop/conf/Configuration.java

@@ -1049,7 +1049,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
 
       //allow includes in the xml file
       docBuilderFactory.setNamespaceAware(true);
-      docBuilderFactory.setXIncludeAware(true);
+      try {
+          docBuilderFactory.setXIncludeAware(true);
+      } catch (UnsupportedOperationException e) {
+        LOG.error("Failed to set setXIncludeAware(true) for parser "
+                + docBuilderFactory
+                + ":" + e,
+                e);
+      }
       DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
       Document doc = null;
       Element root = null;