-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to Jakarta based application servers #1075
Conversation
628ce76
to
1e396dd
Compare
53e8776
to
6fa6229
Compare
cc5d051
to
95d6762
Compare
663432b
to
8dba7a2
Compare
0fa5c49
to
81cb0b0
Compare
688bdcc
to
062a383
Compare
062a383
to
8bdf6cd
Compare
b596e0b
to
f49be74
Compare
f49be74
to
16bf257
Compare
16bf257
to
827adf2
Compare
@tmortagne it this a temporary step to validate the bridge? i.e., do we want to move all |
The way I see it, the idea would be to migrate existing code only after a few releases, and we are happy with how things are behaving. But new code should obviously try to use jakarta APIs as much as possible (I tried to provide jakarta versions of all the APIs and to deprecate javax based ones, at least for stuff which have been migrated already like servlet and inject). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seem to be subtle bugs in some of the adapters and converters. It would be great if we could have automated tests that protect against such bugs similar to the tests that I wrote for listeners, see, e.g., https://github.com/xwiki/xwiki-rendering/blob/9ac37383fe66215642ffc9f01e456c294a9f422f/xwiki-rendering-api/src/test/java/org/xwiki/rendering/listener/chaining/AbstractChainingListenerTest.java#L191. There also appear to be quite some TODOs left, do you plan to implement the missing parts or at least document clearly what is unsupported?
...omponent-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java
Outdated
Show resolved
Hide resolved
...mponent-default/src/main/java/org/xwiki/component/annotation/ComponentDescriptorFactory.java
Show resolved
Hide resolved
...-default/src/main/java/org/xwiki/component/annotation/DefaultComponentDependencyFactory.java
Outdated
Show resolved
Hide resolved
...ommons-component-default/src/test/java/org/xwiki/component/JavaxProviderIntegrationTest.java
Outdated
Show resolved
Hide resolved
...ons-environment-servlet/src/main/java/org/xwiki/environment/internal/ServletEnvironment.java
Outdated
Show resolved
Hide resolved
...akartabridge-servlet/src/main/java/org/xwiki/jakartabridge/servlet/JakartaServletBridge.java
Outdated
Show resolved
Hide resolved
...akartabridge-servlet/src/main/java/org/xwiki/jakartabridge/servlet/JakartaServletBridge.java
Outdated
Show resolved
Hide resolved
...akartabridge-servlet/src/main/java/org/xwiki/jakartabridge/servlet/JakartaServletBridge.java
Show resolved
Hide resolved
...rvlet/src/main/java/org/xwiki/jakartabridge/servlet/internal/JakartaToJavaxAsyncContext.java
Show resolved
Hide resolved
...src/main/java/org/xwiki/jakartabridge/servlet/internal/JakartaToJavaxHttpServletRequest.java
Show resolved
Hide resolved
...ommons-legacy-component-default/src/main/java/org/xwiki/component/embed/GenericProvider.java
Show resolved
Hide resolved
4487179
to
f989213
Compare
XCOMMONS-2797: Allow accessing a javax.inject.Provider as a jakarta.inject.Provider and the opposite XCOMMONS-2963: Upgrade to Servlet 5.0 XCOMMONS-2962: Provide a javax/jakarta bridge for Servlet APIs XCOMMONS-2994: Upgrade to Websocket 2.1.1 XCOMMONS-2108: Upgrade to Bean Validation 3.0.2 XCOMMONS-2109: Upgrade to Hibernate Validator 8.0.1 XCOMMONS-2475: Use Expressly instead of Apache EL
f989213
to
9879228
Compare
XCOMMONS-2797: Allow accessing a javax.inject.Provider as a jakarta.inject.Provider and the opposite XCOMMONS-2963: Upgrade to Servlet 5.0 XCOMMONS-2962: Provide a javax/jakarta bridge for Servlet APIs XCOMMONS-2994: Upgrade to Websocket 2.1.1 XCOMMONS-2108: Upgrade to Bean Validation 3.0.2 XCOMMONS-2109: Upgrade to Hibernate Validator 8.0.1 XCOMMONS-2475: Use Expressly instead of Apache EL * change since place holders
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
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. I also tried to migrate as little as possible from
javax
tojakarta
as a way to test the bridges.Expected merging strategy