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

        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s 1.1 Final [ 12311809 ]
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Digester [ 12310471 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Digester [ 12311111 ]
        Affects Version/s 1.1 Final [ 12311652 ]
        Key COM-135 DIGESTER-32
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 11524 12340286
        Hide
        robertdonkin@mac.com added a comment -

        patch committed.

        many thanks

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development