Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] embedded jetty, war context and slf4j/logback?

Hi Joakim;

and thanks for your feedback on that.

Am 28.02.2014 14:36, schrieb Joakim Erdfelt:

To simplify these rules (this is a gross oversimplification of the
actual behavior).
Default java rules are to check the parent classloader first.
Default servlet rules are to check the webapps classloader first.
Server (implementation) classes are not to be exposed to webapp.

Yes, that's pretty much what I had in mind. What troubled me most about this is seeing logback being initialized with logback.xml found in the classpath of the _web applications_ - globally, even for the loggers defined and used in the app embedding jetty. Should the _server_ look into the classpath of the _webapp_ for this? Or am I wrong here?


 2. Tell the WebAppClassloader to always search the server side
    classloader before the WebAppClassloader
         webapp.setParentLoaderPriority(true);



Yes, that what I ultimately did. Works, after cleaning my maven dependencies a bit, especially differing versions of slf4j pulled by transitive dependencies such as tika. Need to clean this up a bit more...

Thanks for your help anyway, all the best.
Kristian


Back to the top