Mike Elliott <mr..79.net> wrote:
> I get the following message when I try to run a simple JUnit which
> utilizes cayenne:
>
> 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.TestCaseClassLoade..5575e0] whereas object of
type
> log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
[sun.misc.Launcher$AppClassLoade..36228].
> log4j:ERROR Could not instantiate appender named "A1".
There's a very good article that I'm in the process of reading that
describes classloading and why it's so difficult to configure.
I recommend reading the first 11 pages (or more if you're using j2ee).
http://otn.oracle.com/tech/java/oc4j/pdf/ClassLoadingInOC4J_WP.pdf
As Andrus mentioned, the only solution for this problem is to insure that
all of your log4j classes get loaded by the same ClassLoader.
-Mike
This archive was generated by hypermail 2.0.0 : Thu Mar 18 2004 - 09:43:12 EST