logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre StĂžlsvik <En...@Stolsvik.com>
Subject XML parsing problem..
Date Sun, 17 Dec 2000 11:39:19 GMT
I'm trying to get the XML config thing to work with the jaxp early access
1.1 from SUN. This is my classpath, where the three last ones is the jaxp
thingy :

.:/usr/java/jdk1.3/jre/lib/rt.jar
/usr/java/jsdk2.2/servlet.jar
/usr/java/third/webmacro/webmacro.jar
/usr/java/jaxp-1.1ea/crimson.jar
/usr/java/jaxp-1.1ea/jaxp.jar
/usr/java/jaxp-1.1ea/xalan.jar

------------
  I then try to run a class called Test. It's an adaption of the xerces
based XMLSample to jaxp1.1, and uses one of the config files there. Check
the log4j log entries at the bottom of the run here:

endre@endresin:~/testlog/classes$ java Test testconf1.xml 
"doc.getDocumentElement()" gives:

<configuration configDebug="null" disableOverride="null">

        <appender name="A1" class="org.log4j.FileAppender">
            <param name="File" value="A1.log" />
            <param name="Append" value="false" />
            <layout class="org.log4j.PatternLayout">
                <param name="ConversionPattern" value="%t %-5p %c{2} - %m\n" />
            </layout>
        </appender>
        
        <appender name="STDOUT" class="org.log4j.FileAppender">
                <param name="File" value="System.out" />
                
                <layout class="org.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) -
%m\n" />
                </layout>
        </appender>
        
        <category name="Test" additivity="true">
          <priority value="debug" />
          <appender-ref ref="A1" />
        </category>
        
        <root>
           <priority value="debug" />
           <appender-ref ref="STDOUT" />
        </root>
        
</configuration>

log4j: No appender named [A1] could be found.
log4j: No appender named [STDOUT] could be found.
log4j: No appenders could be found for category (Test).
log4j: Please initialize the log4j system properly.

------------------ 

What's happening is apparently that these lines in DOMConfigurator.java
mess up (it does parse the root and categories "correctly", but when it
needs the appenders, it fails):

... 
Document doc = appenderRef.getOwnerDocument(); 
Element element = doc.getElementById(appenderName); 
if(element == null) {
    LogLog.error("No appender named ["+appenderName+"] could be found.");
    return null;
} else {
...

So, the getElementById isn't giving anything back. Why is this? I guess it
have something to do with me using jaxp1.1 and this being made for xerces,
but then there is something wrong somewhere, right?

Anybody had any experience with this?

Thanks!

-- 
Mvh,
Endre


Mime
View raw message