I read in FAQ: <<The DOMConfigurator is based on the DOM Level 1 API. The DOMConfigurator.configure(Element) method will work with any XML parser that will pass it a DOM tree. The DOMConfigurator.configure(String filename) method and its variants require a JAXP compatible XML parser, for example Xerces or Sun's parser. Compiling the DOMConfigurator requires the presence of a JAXP parser in the classpath. >>
But I have a problem! If I use a xerces version 1.2, it's all ok, but if I use a xerces version 1.4, it fails with those errors: log4j: Using URL [file:./classes/log4j_config.xml] for automatic log4j configuration. log4j: System property is :null log4j: Standard DocumentBuilderFactory search succeded. log4j: DocumentBuilderFactory is: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl log4j: URL to log4j.dtd is [jar:file:/C:/lib/log4j/log4j.jar!/org/apache/log4j/xml/log4j.dtd]. Warning: validation was turned on but an org.xml.sax.ErrorHandler was not set, which is probably not what is desired. Parser will use a default ErrorHandler to print the first 10 errors. Please call the 'setErrorHandler' method to fix this. Error: URI=jar:file:/C:/lib/log4j/log4j.jar!/org/apache/log4j/xml/log4j.dtd Line=24: Element type "log4j:configuration" must be declared. Error: URI=jar:file:/C:/lib/log4j/log4j.jar!/org/apache/log4j/xml/log4j.dtd Line=35: Element type "appender" must be declared. Error: URI=jar:file:/C:/lib/log4j/log4j.jar!/org/apache/log4j/xml/log4j.dtd Line=36: Element type "param" must be declared. My xml file start with: <?xml version="1.0" encoding="UTF-8" ?> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="JDBC" class="com.klopotek.utils.log.JDBCAppender"> ....... I think the problem is on dtd verification, can I disable that? Or can I solve the problem? Thanks, Cristiano