Hi Patrick

I have exactly the same proplem. I use tomcat and I get the same ERROR
message. If you have a solution let me know also I will inform you when I
have solved the problem.

Cheers Roland

-----Ursprungliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 16. November 2001 11:41
An: [EMAIL PROTECTED]
Betreff: log4j configuration via XML


Hello,

I try to configure log4j via an XML file but DomConfigurator can't find the
log4j.dtd in the doConfigure(InputStream, Hierarchy) method.

line : URL dtdURL = clazz.getResource("/org/apache/log4j/xml/log4j.dtd");

then i catch an exception :

log4j:ERROR Could not find [log4j.dtd]. Used
[sun.misc.Launcher$AppClassLoader@4c73] class loader in the search.
log4j:ERROR Could not parse input stream [java.io.FileInputStream@26fb].
org.xml.sax.SAXParseException: Document root element is missing.
     java.lang.Throwable(java.lang.String)
     java.lang.Exception(java.lang.String)
     org.xml.sax.SAXException(java.lang.String, java.lang.Exception)
     org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator,
java.lang.Exception)
     void org.apache.crimson.parser.Parser2.fatal(java.lang.String,
java.lang.Object [], java.lang.Exception)
     void org.apache.crimson.parser.Parser2.fatal(java.lang.String)
     void
org.apache.crimson.parser.Parser2.parseInternal(org.xml.sax.InputSource)
     void org.apache.crimson.parser.Parser2.parse(org.xml.sax.InputSource)
     void
org.apache.crimson.parser.XMLReaderImpl.parse(org.xml.sax.InputSource)
     org.w3c.dom.Document
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(org.xml.sax.InputSource)
     org.w3c.dom.Document
javax.xml.parsers.DocumentBuilder.parse(java.lang.String)
     void
org.apache.log4j.xml.DOMConfigurator.doConfigure(java.io.InputStream,
org.apache.log4j.Hierarchy)
     void
org.apache.log4j.xml.DOMConfigurator.doConfigure(java.lang.String,
org.apache.log4j.Hierarchy)
     void org.apache.log4j.xml.DOMConfigurator.configure(java.lang.String)
     void org.apache.log4j.xml.examples.XMLSample.init(java.lang.String)
     void org.apache.log4j.xml.examples.XMLSample.main(java.lang.String [])

What i have to do ??????
----------------------------------------------------------------------------
-------------------------
Another question :

i have some xml sample (which are include in the zip file) like :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration SYSTEM "log4j.dtd">
<configuration>
     <appender name="A1" class="org.apache.log4j.net.SocketAppender">
          <param name="RemoteHost" value="localhost"/>
          <param name="Port" value="5000"/>
          <param name="LocationInfo" value="true"/>
          <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern"value="%t %-5p %c{2} -
%m%n"/>
          </layout>
     </appender>
     <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="debug"/>
          <appender-ref ref="A1"/>
     </category>
     <root>
          <priority value="debug"/>
          <appender-ref ref="STDOUT"/>
     </root>
</configuration>

When i try to open it in ie5.5 i recieve an error message :


 The XML page cannot be displayed


 Cannot view XML input using style sheet.
 Please correct the error and then click
 the Refresh button, or try again later.


 Reference to undeclared namespace prefix:
 'log4j'. Line 4, Position 1


 <configuration>
 ^



Why ??????????????????


Patrick PIERRA


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


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

Reply via email to