Karl Pauls wrote:
On Mon, Jul 7, 2008 at 4:08 PM, Sahoo <[EMAIL PROTECTED]> wrote:
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 [7.0] whereas object of type

log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
[WebappClassLoader

 delegate: false


As someone already pointed out, this seems to be the real issue.

Why would that be an issue?

WebappClassLoader, which is what the war uses to load any class, has loaded ConsoleAppender as well as the interface Appender. In the OSGi classloading space, Appender is loaded by some bundle's class loader. I was thinking that somehow the ConsoleAppender as loaded by the application class loader is coming in contact with Appender which is loaded by a bundle.
Try setting the following in felix/config.properties file or whatever 
equivalent way to
pass it while invoking Felix using an API:

org.osgi.framework.bootdelegation=sun.*,com.sun.*, org.apache.log4j.*
I am not suggesting this as a long term solution, but this can take us
towards the solution.

How?

Since Felix is started by the web app, Felix would use that web app's class loader for any delegation. By having this property, both OSGi bundles should see same log4j classes as the web app.

Thanks,
Sahoo
regards,

Karl

Thanks,
Sahoo




Reply via email to