You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/12/01 18:36:18 UTC

DO NOT REPLY [Bug 25112] New: - The Digester can't find a "digester-rules.dtd", although it is located in commons-digester.jar

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25112>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25112

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

           Summary: The Digester can't find a "digester-rules.dtd", although
                    it is located in commons-digester.jar
           Product: Commons
           Version: 1.5 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Digester
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: macroprose@ukr.net


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org