Details
-
Bug
-
Resolution: Fixed
-
Major
-
10.8
-
Jetty 9.4.12 and minimal XWiki WAR
-
Unknown
-
N/A
-
N/A
-
Description
Thanks to our TestContainers-based testing fwk, I noticed that installing some extensions on Jetty fails with:
Caused by: java.lang.Exception: Job execution failed. Response status code [500], reason [The job failed (InstallException: Dependency [org.ow2.asm:asm-commons-6.2.1] is not compatible with core extension feature [org.ow2.asm:asm-commons/6.2] ([org.ow2.asm:asm-commons/6.2]))]
The reason is because we use ASM 6.2.1 in XWiki and Jetty bundles version 6.2 in its lib directory:
jetty@02340d2a0684:/usr/local/jetty$ find . -name "*asm*.jar" ./lib/annotations/asm-commons-6.2.jar ./lib/annotations/asm-6.2.jar jetty@02340d2a0684:/usr/local/jetty$
What's weird though is that according to http://www.eclipse.org/jetty/documentation/9.4.x/jetty-classloading.html#adding-extra-classpaths:
Adding Jars under $jetty.home/lib/ext to the system classpath. You can place additional Jars here. The normal configuration is that each web context (web application or WAR file) has its own classloader, which has the system classloader as its parent
and
Classes contained within WEB-INF/lib or WEB-INF/classes have priority over classes on the parent classloader. This is the opposite of the normal behavior of a Java 2 classloader