logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Lindsey" <nis...@pobox.com>
Subject odd problem with log4j + tomcat + junit
Date Mon, 08 Jan 2001 04:07:42 GMT
Hi, I just started using log4j (it looks great so far!) and I'm having
an odd problem.

I'm doing some servlet stuff with Tomcat, and I can't get my servlets to
log via log4j.  When my servlet trys to load my log conf file via
DOMConfigurator.configure(), it generates this exception:



2001-01-07 10:43:40 - Ctx( /vppservlets ): Exception in: R( /vppservlets
+ /FindGroup + null) - java.lang.NoSuchMethodError
        at
org.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.ja
va:101)
        at
org.log4j.xml.DOMConfigurator.parseChildrenOfCategoryElement(DOMConfigur
ator.java:329)
        at
org.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:287)
        at org.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:591)
        at
org.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:444)
        at
org.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:533)
        at com.incanta.vppcr.FindGroup.<init>(FindGroup.java:34)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:26
8)
        at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
        at org.apache.tomcat.core.Handler.service(Handler.java:254)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
a:797)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416
)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49
8)
        at java.lang.Thread.run(Thread.java:484)



Line 101 of org.log4j.xml.DOMConfigurator.findAppenderByReference is:

	Element element = doc.getElementById(appenderName);

Hmm, so it seems Tomcat can't find the getElementById(string) method.
But Tomcat is using the same class path as junit, and the log4j calls in
my junit tests (which are identical to the ones in my servlets) work
just fine: they throw no exceptions and produce the output that one
would expect.

Clearly, I must simply have something configured wrong.  I thought I
would try this list (after the FAQ and google failed to help) in the
hope that someone else had seen this sort of thing and could simply say
"oh, you need to do foo."

Thanks.

Oh, BTW, I'm using the latest release versions of everything: tomcat,
log4j, junit, xerces, etc.

--
John Lindsey    mailto:nisroc@pobox.com    http://pobox.com/~nisroc


Mime
View raw message