log4j:WARN Document root element "log4j:configuration", must match DOCTYPE root "null" log4j:WARN Document root element "log4j:configuration", must match DOCTYPE root "null" xml xml

log4j:WARN Document root element "log4j:configuration", must match DOCTYPE root "null"


Add the following line to your log4j.xml config file right after the <xml> element:

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

Complete log4j Configuration Example from their wiki:

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"><log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">  <appender name="console" class="org.apache.log4j.ConsoleAppender">     <param name="Target" value="System.out"/>     <layout class="org.apache.log4j.PatternLayout">       <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/>     </layout>   </appender>   <root>     <priority value ="debug" />     <appender-ref ref="console" />   </root></log4j:configuration>


The jar that is producing this message expects to see a DTD validated, not schema validated configuration.

Check your classpath. You are using a too old version of the framework for this configuration. Very likely you have multiple versions of a jar with the same name on your disk, and such occurences will point you to the problem and to removal of very old libraries that you do not really want to use.