You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by John Caron <ca...@unidata.ucar.edu> on 2006/01/21 03:11:24 UTC

XML config DOCTYPE error message

I am using an XML config file (posted below). I always get the following error message when starting the application:

log4j:ERROR Parsing error on line 2 and column 83
log4j:ERROR Document root element "log4j:configuration", must match DOCTYPE root "null".
log4j:ERROR Parsing error on line 2 and column 83
log4j:ERROR Document is invalid: no grammar found.

It doesnt appear to affect anything, but its annoying. Anyone know how to fix or get rid of message?

Thanks!

<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration debug="false" xmlns:log4j='http://jakarta.apache.org/log4j/'>

  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
    <param name="Threshold" value="WARN" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%-5p %c : %m %d{yyyy-MM-dd HH:mm:ss.SSS} [%10r] %n"/>
    </layout>	    
  </appender>

  <logger name="ucar">
    <level value="WARN"/>
  </logger>

  <root>
    <level value="WARN"/>
    <appender-ref ref="STDOUT"/>
  </root>

</log4j:configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: XML config DOCTYPE error message

Posted by John Caron <ca...@unidata.ucar.edu>.
Hi Jacob:

Thanks very much. 
Sometimes you can't see whats right in front of you!

John

Jacob Kjome wrote:
> At 07:11 PM 1/20/2006 -0700, you wrote:
>  >I am using an XML config file (posted below). I always get the following
>  >error message when starting the application:
>  >
>  >log4j:ERROR Parsing error on line 2 and column 83
>  >log4j:ERROR Document root element "log4j:configuration", must match 
> DOCTYPE
>  >root "null".
>  >log4j:ERROR Parsing error on line 2 and column 83
>  >log4j:ERROR Document is invalid: no grammar found.
>  >
>  >It doesnt appear to affect anything, but its annoying. Anyone know how to
>  >fix or get rid of message?
> 
> Try adding this to the second line (the line below <?xml ...?>)...
> 
> 
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> 
> 
>  >
>  >Thanks!
>  >
>  ><?xml version="1.0" encoding="UTF-8" ?>
>  ><log4j:configuration debug="false"
>  >xmlns:log4j='http://jakarta.apache.org/log4j/'>
>  >
>  >  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
>  >    <param name="Threshold" value="WARN" />
>  >    <layout class="org.apache.log4j.PatternLayout">
>  >      <param name="ConversionPattern" value="%-5p %c : %m %d{yyyy-MM-dd
>  >HH:mm:ss.SSS} [%10r] %n"/>
>  >    </layout>
>  >  </appender>
>  >
>  >  <logger name="ucar">
>  >    <level value="WARN"/>
>  >  </logger>
>  >
>  >  <root>
>  >    <level value="WARN"/>
>  >    <appender-ref ref="STDOUT"/>
>  >  </root>
>  >
>  ></log4j:configuration>
>  >
>  >
>  >---------------------------------------------------------------------
>  >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>  >For additional commands, e-mail: log4j-user-help@logging.apache.org
>  >
>  >
>  > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: XML config DOCTYPE error message

Posted by Jacob Kjome <ho...@visi.com>.
At 07:11 PM 1/20/2006 -0700, you wrote:
 >I am using an XML config file (posted below). I always get the following
 >error message when starting the application:
 >
 >log4j:ERROR Parsing error on line 2 and column 83
 >log4j:ERROR Document root element "log4j:configuration", must match DOCTYPE
 >root "null".
 >log4j:ERROR Parsing error on line 2 and column 83
 >log4j:ERROR Document is invalid: no grammar found.
 >
 >It doesnt appear to affect anything, but its annoying. Anyone know how to
 >fix or get rid of message?

Try adding this to the second line (the line below <?xml ...?>)...


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


 >
 >Thanks!
 >
 ><?xml version="1.0" encoding="UTF-8" ?>
 ><log4j:configuration debug="false"
 >xmlns:log4j='http://jakarta.apache.org/log4j/'>
 >
 >  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
 >    <param name="Threshold" value="WARN" />
 >    <layout class="org.apache.log4j.PatternLayout">
 >      <param name="ConversionPattern" value="%-5p %c : %m %d{yyyy-MM-dd
 >HH:mm:ss.SSS} [%10r] %n"/>
 >    </layout>
 >  </appender>
 >
 >  <logger name="ucar">
 >    <level value="WARN"/>
 >  </logger>
 >
 >  <root>
 >    <level value="WARN"/>
 >    <appender-ref ref="STDOUT"/>
 >  </root>
 >
 ></log4j:configuration>
 >
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
 >For additional commands, e-mail: log4j-user-help@logging.apache.org
 >
 >
 >  


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org