commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From __matthewHawthorne <ma...@phreaker.net>
Subject Re: Debugging LogConfigurationException with commons-logging 1.0.3 (and log4j 1.2.8)
Date Mon, 08 Sep 2003 15:41:32 GMT
I've experienced a fair amount of problems with similar looking stack 
traces, all of which were related to commons-logging/log4j versioning 
issues.  However, from what I can tell, your versions look OK. 
Typically it happens with the older versions of log4j.

Perhaps commons-logging is having problems instantiating the underlying 
log4j class.  You say you are running "standalone" code, I interpret 
this to mean that you are not running inside of a container? (such as 
Tomcat, Weblogic, etc).  Sometimes the classloading inside of containers 
can be confusing.

I've never heard of this logging.properties file, I didn't think that 
commons-logging allowed any direct configuration.  Try to reference a 
log4j class directly, before your call to commons-logging to make sure 
that the classes are loaded and accessible.

Maybe try to set the log4j system property (look in the log4j 
documentation, but I think it's log4j.debug=TRUE) to see if any 
configuration errors are occurring on the log4j side.

We need some better documentation for errors like this, they seem to 
happen a lot, and provide a consistent source of confusion.  I'd write 
them myself if I understood the problem better.

I hope this has been more helpful than chaotic...




Karr, David wrote:

> I'm trying to run some standalone code that uses commons-logging and
> log4j, but I'm getting a LogConfigurationException.  I can't find any
> useful information on what is really going wrong.
> 
> The stack trace is as follows:
> ----------------
> org.apache.commons.logging.LogConfigurationException:
> java.lang.reflect.InvocationTargetException
> 	at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
> l.java:532)
> 	at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
> l.java:272)
> 	at
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
> logger[null]
> 	at
> com.wamu.tsg.eai.reporting.collect.MessageManager.<init>(MessageManager.
> java:33)
> 	at
> com.wamu.tsg.eai.reporting.collect.MessageManager.main(MessageManager.ja
> va:55)
> java.lang.NullPointerException
> 	at
> com.wamu.tsg.eai.reporting.collect.MessageManager.main(MessageManager.ja
> va:83)
> ----------------
> 
> I have a "log4j.properties" file, which I'm putting in the classpath
> when the application is run.  I don't have a "logging.properties" file
> (I believe that's the name that commons-logging looks for).  I'm using
> JDK 1.3.1_08.
> 
> What else can I do to get more information about what is going wrong?




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


Mime
View raw message