Hello,

I'm not sure if this is more appropriate in the log4j mailing list, but
hopefully it's relevant here.

I'm using log4j 1.2alpha6 and my JUnit tests, when run via Ant 1.4.1, are
failing to log correctly. I've figured out that the default class loader
that Ant is using is different from the one log4j is using when configuring
appenders from a properties file.

The log4j FAQ says that they're using the Java 2 "preferred method for
loading classes" now:

    Thread.currentThread().getContextClassLoader().loadClass()

Unfortunately, the context class loader for the current thread is not the
Ant class loader but rather the built-in JRE class loader. What I'm getting
is:

    log4j:ERROR: A "foo.mumble.MyAppender" object is not assignable
                 to a "org.apache.log4j.Appender" variable.

Sure enough, from looking at the code, the older log4j 1.1.3 just uses
Class.forName() to load the classes, which works, but the newer one uses the
syntax above, which doesn't.

Has anyone had this problem? Is there a way around this? Thanks so much in
advance,

Dave H

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

Reply via email to