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 [EMAIL PROTECTED]
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 installation.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to