Move to Jakarta based application servers #1075
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See xwiki/xwiki-rendering#318 for the rendering side of things.
See xwiki/xwiki-platform#3388 for the platform side of things.
Jira URLs
Changes
Description
The idea is to do just enough for XWiki to work in jakarta based Application servers (Jetty 11+, Tomcat 10+).
Important
This PR might look like a big change already but it's actually very far from a 100% jakarta XWiki. What was done is really just the strict minimum to work in a jakarta application server and there will still be a lot of work after that to fully migrate to jakarta.
See https://design.xwiki.org/xwiki/bin/view/Proposal/Jakartamigration for more details.
Jakarta WebSocket 2.1.1
XWiki has been migrated to WebSocket 2.1.1 without any kind of bridge, so every WebSocket related APIs are broken. There was no obvious way to keep supporting WebSocket 1 but fortunately no use of those APIs were found in contrib extensions.
Jakarta Validation 3.0.2
XWiki has been migrated to Validation 3.0.2 (and Hibernate Validator 8.0.1) without any kind of bridge. A Javax Validation API JAR remain in the XWiki WAR because it's referenced by Jersey, but XWiki itself only support Jakarta Validation. In practice, it just means that Javax Validation annotations used in a contrib extension are going to be ignored. It's easy for an extension to support both Javax and Jakarta XWiki versions by declaring both Java Javax and Jakarta Validation annotations.
Jakarta Servlet 5.0
Migration to jakarta
javax.servlet
<->jakarta.servlet
has been introduced.Filter
andServlet
implementations declared inweb.xml
have all been moved to jakarta without keeping a javax compatible version. The reason is that there is no point keeping supporting those if XWiki is only used in jakarta based application servers, keeping the same class name also reduce the number of changes in theweb.xml
(in a sense, breaking them improve retro compatibility).Behavior changes
Jakarta Inject 2.0.1
It was probably not strictly required, but both javax and jakarta Inject APIs are now supported at the same time.
TODO
<Connector
element inserver.xml
)Executed Tests
Not much new tests, but every single UI test and a lot of unit tests are impacted by this change so just the fact that they are passing is a good test.
Expected merging strategy