Uploaded image for project: '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
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      25112

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              macroprose@ukr.net Sergey Proskurnya
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: