Commons Digester
  1. Commons Digester
  2. DIGESTER-32

[PATCH digester] FileNotFoundException for included xmlrule files in a jar

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: PC

      Description

      if xmlrule files are packed into a jar and one rule xml file includes another
      rule file by the <include> tag, the included file would not be found by the
      parser. (FileNotFoundException).

      A simple patch is change the code in method
      org.apache.commons.digester.xmlrules.DigesterRuleParser.includeXMLRules()
      at line #344:

      FROM

      fileName = fileURL.getFile();

      TO

      fileName = fileURL.toExternalForm();

      The original fileURL.getFile() would get rid of the protocol part of the URL so
      it will not preserve the "jar:file:..." and no way for the Sax Parser to find
      the included XML file.

      Henri Chen
      P.S. I am using jdk 1.4

        Activity

        Hide
        robertdonkin@mac.com added a comment -

        patch committed.

        many thanks

        • robert
        Show
        robertdonkin@mac.com added a comment - patch committed. many thanks robert

          People

          • Assignee:
            Unassigned
            Reporter:
            Henri Chen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development