logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Exception
Date Mon, 16 Jul 2007 16:35:40 GMT

On Jul 14, 2007, at 4:00 PM, Kenton wrote:

> I'm getting this exception in my Struts application. It looks like  
> a log4j
> exception (or is it a Tomcat/catalina exception?). Any ideas on how  
> I can
> get this resolved?
> java.lang.NullPointerException
>         at java.lang.String.startsWith(String.java:1422)
>         at java.lang.String.startsWith(String.java:1451)
>         at
> org.apache.naming.resources.FileDirContext.file(FileDirContext.java: 
> 916)
>         at
> org.apache.catalina.loader.WebappClassLoader.getResource 
> (WebappClassLoader.java:1181)
>         at org.apache.log4j.helpers.Loader.getResource(Loader.java: 
> 109)
>         at org.apache.log4j.LogManager.<clinit>(LogManager.java:105)
>         at org.apache.log4j.Logger.getLogger(Logger.java:104)
>         at

The exception occurs when log4j is trying to find either  
"log4j.properties" or "log4j.xml" to perform default initialization  
(can't be sure which one since your line numbers don't align with the  
current source).  The resource names are stored in static final  
members.  There are two possibilities that I see:

a) either Tomcat's app reloading mechanism result in the static final  
members being null and not the expected value.  The null passed down  
through the Tomcat class loaders results in the NPE.

b) The expected value gets passed down to Tomcat and there is an  
implementation bug in Tomcat's class loader.

Looks like something Tomcat specific and you would have better like  
reposting on tomcat-user and specifying what version on Tomcat you  
are using and the conditions under which the exception is encountered.

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

View raw message