On Mon, Jul 7, 2008 at 11:24 PM, Stuart McCulloch
<[EMAIL PROTECTED]> wrote:
> however, setting this would break Pax-Logging, because then the application
> would load the Log4J public API classes from the standard Log4J jar - rather
> than the custom classes from Pax-Logging that fix Log4J logging for OSGi
>
> note you can use mandatory attributes in your manifest if you want to ensure
> that bundles always use the Log4J public classes provided by Pax-Logging:
>
>    http://www.ops4j.org/projects/pax/logging/userguide.html
>
> wrt. the error - the Appender class is probably from the Pax-Logging service
> bundle, which has a Log4J backend - however, this is private to the bundle
> and also contains ConsoleAppender, so it's strange that these two classes
> are being loaded by different classloaders
>
> it looks like the web containers classes are somehow visible to the bundles,
> although the Felix classloader should be keeping them hidden (unless the
> bootdelegation property is set)

Well, it will take me a while to go through the entire discussion, but

org.osgi.framework.bootdelegation=sun.*,com.sun.*, org.apache.log4j.*

is mentioned above, which I think will create a mess. Not only will
Pax Logging Service use those classes, instead of the internal ones,
but I suspect (need to check the spec) that Pax Logging API will also
use those, which won't work.

The original post seems to indicate that indeed the Log4J classes are
loaded by the web containers classloader, and I can't figure out the
possible breakage scenarios in that case. Please note that the Pax
Logging manifests are trying hard to bind compatible versions of the
packages involved to each other with mandatory attributes.

Another indicator that some "other" Log4J is involved is the
"log4j:WARN No appenders could be found for logger", since Pax Logging
do not utilize the Log4J auto discovery of log4j.properties file, and
instead do an active call to the configuration system in Log4J.

If the entire project is publicly available, please point me to it,
and I'll try to figure out what is going on.


Cheers
Niclas

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to