Commons Digester
  1. Commons Digester
  2. DIGESTER-63

The Digester can't find a "digester-rules.dtd", although it is located in commons-digester.jar

    Details

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

      Operating System: other
      Platform: Other

      Description

      Running the following piece of code:
      d = new Digester();
      try {
      d.setValidating(false);
      d.addRuleSet(new FromXmlRuleSet(getClass().getResource("/myrules.xml")));
      d.push(this);
      d.parse(getClass().getResourceAsStream("/schema.xml"));
      } catch (MalformedURLException mue) {
      logger.error(mue);
      } catch (IOException ioe) {
      logger.error(ioe);
      } catch (SAXException se) {
      logger.error(se, se);
      }
      I have got the exception:
      [java] org.apache.commons.digester.xmlrules.XmlLoadException:
      E:\projects\test\digester\digester-rules.dtd (The system cannot find the file
      specified)
      [java] at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1663)
      [java] at com.sunbay.test.MyDigester.<init>(MyDigester.java:23)
      [java] at com.sunbay.test.Startup.test(Startup.java:46)
      ...

      It is obvious that the system is trying to find "digester-rules.dtd" DTD,
      but why it searches in my project root?
      While debugging the org/apache/commons/digester/xmlrules/FromXmlRuleSet.class,
      I have found the following line:
      URL dtdURL =
      getClass().getClassLoader().getResource("org/apache/commons/digester/xmlrules/digester-rules.dtd")
      I think this is the problem, because when I have change it to
      getClass().getClassLoader().getResource("/org/apache/commons/digester/xmlrules/digester-rules.dtd")
      all started work correctly (i.e. DTD was obtained from commons-difester.jar).
      So, please, change it in your codebase.

        Activity

        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s 1.5 Final [ 12311691 ]
        Henri Yandell made changes -
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Project Commons [ 12310458 ] Commons Digester [ 12310471 ]
        Affects Version/s 1.5 Final [ 12311664 ]
        Component/s Digester [ 12311111 ]
        Key COM-981 DIGESTER-63
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 25112 12341132
        Sergey Proskurnya created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Sergey Proskurnya
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development