Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-17088

Failed to load XInclude files with relative path.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.1
    • 3.3.1
    • conf

    Description

      When we create a configuration file, which load a external XML file with relative path, and try to load it via calling `Configuration.addResource` with `Path(URI)`, we got an error, which failed to load a external XML, after https://issues.apache.org/jira/browse/HADOOP-14216 is merged.

      Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Fetch fail on include for 'mountTable.xml' with no fallback while loading 'file:/opt/hadoop/etc/hadoop/core-site.xml'
      	at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3021)
      	at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2973)
      	at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2848)
      	at org.apache.hadoop.conf.Configuration.iterator(Configuration.java:2896)
      	at com.company.test.Main.main(Main.java:29)
      Caused by: java.io.IOException: Fetch fail on include for 'mountTable.xml' with no fallback while loading 'file:/opt/hadoop/etc/hadoop/core-site.xml'
      	at org.apache.hadoop.conf.Configuration$Parser.handleEndElement(Configuration.java:3271)
      	at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3331)
      	at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3114)
      	at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3007)
      	... 4 more
      

      The cause is that the URI is passed as string to java.io.File constructor and File does not support the file URI, so my suggestion is trying to convert from string to URI at first.

      Attachments

        Issue Links

          Activity

            People

              yhaya Yushi Hayasaka
              yhaya Yushi Hayasaka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h