When running with JDK 1.4 I get the same error, but adding the namespace
doesn't help.  It works fine under JDK 1.3.x.

===

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:/src/common/lib/log4j.jar!/org/apache/log4j/xml/log4j.dtd
Line=3: Element type "log4j:configuration" is not declared.
Error:
URI=jar:file:/C:/src/common/lib/log4j.jar!/org/apache/log4j/xml/log4j.dtd
Line=3: Attribute "xmlns:log4j" is not declared for element
"log4j:configuration".
Error:
URI=jar:file:/C:/src/common/lib/log4j.jar!/org/apache/log4j/xml/log4j.dtd
Line=4: Element type "root" is not declared.

===

<?xml version="1.0" encoding="UTF-8" ?>

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
....
</log4j:configuration>

===

-Jim Moore

-----Original Message-----
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 13, 2001 4:38 AM
To: LOG4J Users Mailing List
Subject: Re: java org.apache.log4j.performance.Logging Undeclared
prefix: "log4j:configuration"



Hello,

This is due to a missing namespace declaration.

Change <log4j:configuration>

to 

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

Regards, Ceki

ps: I'll fix this for the next release.


At 12:46 13.06.2001 +0800, Liang Sun wrote:
>Hi,
>
>I tried to run java org.apache.log4j.performance.Logging with sample1.xml
>in the log4j 1.1.2 bundle but got this error. If I change the line
><log4j:configuration> to <configuration> I'm able to run the test with a
>few warning. I've checked the local copy of log4j.dtd and it looks fine,
>no typo bug like "logj:configuration". I've attached sample1.xml below the
>error messages. Where did I go wrong ?
>
>java org.apache.log4j.performance.Logging /h
>liangsun/sample1.xml 10 10 10
>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:/home/liangsun/java/JBoss-2.2.1_Jetty3.1.RC4/jboss/lib/ext/l
>og4j.jar!/org/apache/log4j/xml/log4j.dtd Line=4: Undeclared prefix:
>"log4j:confi
>guration".
>log4j:ERROR Could not parse input stream [java.io.FileInputStream@21b6d].
>java.lang.NullPointerException
>        at
>org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:523)
>        at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
>        at
>org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
>        at
>org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
>.java:179)
>        at
>org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
>:585)
>        at
>org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
>:520)
>        at
>org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:5
>99)
>        at org.apache.log4j.performance.Logging.init(Logging.java:264)
>        at org.apache.log4j.performance.Logging.main(Logging.java:225)
>log4j:ERROR No appenders could be found for category
>(A0123456789.B0123456789.C0
>123456789).
>log4j:ERROR Please initialize the log4j system properly.
>actual time: 1900.0
>
>
><?xml version="1.0" encoding="UTF-8" ?>
><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>
><log4j:configuration debug="false">
>
>    <appender name="STDOUT" class="org.apache.log4j.FileAppender">
>           <param name="File" value="System.out" />
>           <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern"
>            value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
>           </layout>
>    </appender>
>
>    <category name="org.apache.log4j.xml">
>      <priority value="info" />
>    </category>
>
>    <root>
>       <priority value ="debug" />
>       <appender-ref ref="STDOUT" />
>    </root>
>
></log4j:configuration>

--
Ceki Gülcü


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to