Hello Charles,

I recently had a similar problem that I brought up on the Karaf user list:

http://mail-archives.apache.org/mod_mbox/karaf-user/201211.mbox/%3CCAJ0TPG%2BERzf6Q709cndh-YqfP_HQq%3DVk6iA4ZQfEtZE7tJPWUw%40mail.gmail.com%3E

Although my problem was that the application classloader had already loaded
some log4j classes due to the CLASSPATH environment variable on Windows, I
noted that everything worked fine using Equinox instead of Felix.

Apparently Equinox does some tricks when it comes to hiding already loaded
classes. Maybe Felix developers can take a look at what Equinox is doing
and perhaps do something similar in Felix thus making Felix more resilient
to "polluted" classloaders.

/Bengt



2010/11/18 Charles Moulliard <[email protected]>

> Hi,
>
> Some months ago, an interesting question has been drawn about the
> classloading issue of log4j class when we use pax-logging bundle within
> Felix embedded in a web application.
>
> http://www.mail-archive.com/**[email protected]/msg04908.**html<http://www.mail-archive.com/[email protected]/msg04908.html>
>
> I'm faced to the same issue when I would like to use Apache Karaf (top
> level container of Apache Felix) deployed as a WAR.
>
> Does anybody has find a trick to solve the classloading issue ?
>
> INFO: locking
> 2010-11-18 18:08:36.667:INFO::Started [email protected].**
> 0:8080 <http://[email protected]:8080>
> [INFO] Started Jetty Server
> [INFO] Starting scanner at interval of 10 seconds.
> 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 [4.0] whereas object of type
> log4j:ERROR "org.apache.log4j.**ConsoleAppender" was loaded by
> [ContextLoader@ServiceMix Embedded Example].
>
>
> Regards,
>
> Charles M.
> Apache Camel, ServiceMix & Karaf committer
>

Reply via email to