[
https://issues.apache.org/jira/browse/TOMEE-4242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17781043#comment-17781043
]
Jonathan Gallimore commented on TOMEE-4242:
-------------------------------------------
Running with TomEE 8.0.16, and the following in my .war file:
./WEB-INF
./WEB-INF/web.xml
./WEB-INF/lib
./WEB-INF/lib/logback-classic-1.2.11.jar
./WEB-INF/lib/logback-core-1.2.11.jar
./WEB-INF/classes
./WEB-INF/classes/org
./WEB-INF/classes/org/superbiz
./WEB-INF/classes/org/superbiz/logger
./WEB-INF/classes/org/superbiz/logger/example
./WEB-INF/classes/org/superbiz/logger/example/TestServlet.class
./WEB-INF/classes/logback.xml
Logback is not picked up and used (i.e. I'm not able to reproduce your
'success' case with a webapp with the structure above and vanilla TomEE 8).
With the changes proposed on the mailing list last week, my expectation is that
slf4j 1.x and slf4j 2.x application will both work if the API jar and binding
are both provided in the WEB-INF/lib folder. I wouldn't expect it to work
without the API jar being present - simply down to how SLF4J works internally.
Please do let me know if I have your success case on TomEE 8.x wrong and I'll
try again.
> Changed Default ClassLoader Behaviour
> -------------------------------------
>
> Key: TOMEE-4242
> URL: https://issues.apache.org/jira/browse/TOMEE-4242
> Project: TomEE
> Issue Type: Bug
> Affects Versions: 9.1.0
> Reporter: Katja Zip
> Priority: Major
>
> We are migrating a Web-Application from TomEE 8.0.14 to TomEE 9.1.0. On the
> new TomEE version we encounter problems in class loading. One of the symptoms
> is, that SLF4J no longer used the application specific binding to logback,
> but the TomEE configured JUL binding instead. This is caused by resolving the
> SLF4J \{{LoggerFactory}} from the parent classloader. If we include a
> context.xml in our application's META-INF folder with the following content,
> the problem disappears:
> {code:xml}
> <Context>
> <Loader delegate="false" />
> </Context>
> {code}
> If the delegate property is set to true, we get the same behaviour as we
> experienced without the context.xml.
> This is an unexpected change in the TomEE behaviour between the two versions.
> It indicates, that \{{true}} is likely the default behaviour. This is
> opposite to the Tomcat documentation, which indicates \{{false}} to be the
> default: https://tomcat.apache.org/tomcat-10.0-doc/class-loader-howto.html.
> Furthermore, the Java Servlet specification also states, that the application
> classes should bee loaded before the system classes.
> Why was the default behaviour for the class loading changed? Are there other
> implications, that we need to be aware of, that our mitigation causes?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)