I'm getting an exception when I try to run my application (in eclipse) complaining about log4j.dtd. Am I meant to have a dtd file if I use the xml configuration for log4j?
Caused by: java.io.FileNotFoundException:
C:\data\workspace\LDICommon_Trunk\resources\log4j.dtd (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
If you are using XML-based log4j, then yes, you will need the DTD file. Copy this DTD file into your workspace: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd
Make sure it sits at the same directory as your log4j XML file.
Check your log4j.xml it must be looking for log4j.dtd
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
Instead you can use:
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With