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: Log4J exception
Date Tue, 04 Nov 2008 21:41:13 GMT

On Nov 4, 2008, at 1:32 PM, Tom Hsu wrote:

> Hi experts,
> I am using a an xml document to configure the Log4j from apache.  
> However, I am seeing an class cast exception when I try to run my  
> Java program which configures the log4j through a xml document. The  
> trace is attached. I don't understand the following 2 errors:
> 1. java.lang.ClassCastException: org.apache.log4j.ConsoleAppender  
> cannot be cast to org.apache.log4j.Appender
> 2.log4j:ERROR Could not parse input source  
> [org.xml.sax.InputSource@200db9].
> java.lang.NullPointerException
> I am sure that the xml is well-formed because I was able to use that  
> xml in an existing system. I have also attached the xml config file.  
> If anyone can provide some pointers, it'd be greatly appreciated!

You don't mention the environment that you are running the code in,  
but it would appear that you have multiple class loaders and that is  
causing the cast from ConsoleAppender to Appender to fail.  The  
ClassCastException results in the NullPointerException that occurs  
later.  Please check if you have multiple log4j.jar's in your  

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

View raw message