Are you running the tests using Ant? If the junit tests are run is a separate JVM the ignoreTCL directive will not be seen by the separate JVM. For example,
<junit fork="yes"> <jvmarg value="-Dlog4j.ignoreTCL=true"/> .... </junit> See Ant documentation for further details. Which version of Junit is this? Can you provide details about junit.runner.TestCaseClassLoader? What are its parents? Does it have a copy of log4j.jar accessible to it? At 15:11 26.09.2002 -0600, you wrote: >Ceki, > >When I run a JUnit TestCase which initiate Torque in the setUp() method, > >I got the following messages from log4j: > >log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not >assignable to a "org.apache.log4j.Appender" variable. >log4j:ERROR The class "org.apache.log4j.Appender" was loaded by >log4j:ERROR [junit.runner.TestCaseClassLoader@45fde0] whereas object of >type >log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by >[sun.misc.Launcher$AppClassLoader@ac738]. >log4j:ERROR Could not instantiate appender named "STDOUT". >log4j:ERROR A "org.apache.log4j.FileAppender" object is not assignable >to a "org.apache.log4j.Appender" variable. >log4j:ERROR The class "org.apache.log4j.Appender" was loaded by >log4j:ERROR [junit.runner.TestCaseClassLoader@45fde0] whereas object of >type >log4j:ERROR "org.apache.log4j.FileAppender" was loaded by >[sun.misc.Launcher$AppClassLoader@ac738]. >log4j:ERROR Could not instantiate appender named "default". >log4j:ERROR A "org.apache.log4j.FileAppender" object is not assignable >to a "org.apache.log4j.Appender" variable. >log4j:ERROR The class "org.apache.log4j.Appender" was loaded by >log4j:ERROR [junit.runner.TestCaseClassLoader@45fde0] whereas object of >type >log4j:ERROR "org.apache.log4j.FileAppender" was loaded by >[sun.misc.Launcher$AppClassLoader@ac738]. >log4j:ERROR Could not instantiate appender named "org.apache.torque". >log4j:WARN No appenders could be found for logger >(org.apache.torque.Torque). >log4j:WARN Please initialize the log4j system properly. > >The exception that I got from my unit test was: >java.lang.ExceptionInInitializerError: >org.apache.commons.logging.LogConfigurationException: >org.apache.commons.logging.LogConfigurationException: >...(the line was cut from on the Junit console) The rest of the stack could have been helpful... >After I posted my problem to log4j-dev, I found that it should be posted > >to log4j-user so I posted it again to log4j-user right after. The more details you provide the easier will it be to identify and fix the problem.... >Pricilla Yin -- Ceki TCP implementations will follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others. -- Jon Postel, RFC 793 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>