Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmortagne
Copy link
Member

@tmortagne tmortagne commented Sep 2, 2024

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+).

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

  • A javax.servlet <-> jakarta.servlet has been introduced.
  • No Servlet related API should be broken.
  • Except that the Filter and Servlet implementations declared in web.xml has 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.
  • Redirect URL are now checked in all contexts (injected by a servlet filter for all requests)
  • By default, relative redirect URLs are now resolved by XWiki instead of the application server (reduce setups requirement)
  • All the oldcore servlet related APIs are now deprecated
    • The most commons Servlet related API has been added to the Container API to reduce the need to directly access it
    • A new script oriented Container API has been introduced
  • New Tomcat 10 based Debian packages

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.

Not migrated

It's not strictly required to migrate everything to jakarta.* to work in a jakarta application server like Jetty or Tomcat (we should do it eventually of course, but we can do that in several steps):

See https://design.xwiki.org/xwiki/bin/view/Proposal/Jakartamigration for more details.

TODO

  • make Sonar happy with the new rules
  • try to hack Jetty EE10 to force it to allow special escaped characters
  • quite a few UI tests failing (but need to fix previous point first to reduce the noise since it's causing a lot of those)
  • check if it's still possible to allow any special escaped character in Tomcat 10.1 and 11 just with configuration
  • run/fix Environment Tests
  • would be good to optimize a bit more the size of the xjetty package (i.e. add some more JAR exclusions)

Executed Tests

Expected merging strategy

  • Prefers squash: Yes

@tmortagne tmortagne force-pushed the feature-deploy-jakarta branch 6 times, most recently from 628ce76 to 1e396dd Compare September 9, 2024 08:06
@tmortagne tmortagne force-pushed the feature-deploy-jakarta branch 4 times, most recently from 53e8776 to 6fa6229 Compare September 18, 2024 13:51
@tmortagne tmortagne force-pushed the feature-deploy-jakarta branch 2 times, most recently from cc5d051 to 95d6762 Compare October 4, 2024 12:22
@tmortagne tmortagne force-pushed the feature-deploy-jakarta branch 5 times, most recently from 663432b to 8dba7a2 Compare October 24, 2024 10:14
@tmortagne tmortagne force-pushed the feature-deploy-jakarta branch 4 times, most recently from 2051d5e to b5f9c9f Compare November 4, 2024 17:09
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant