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

Support for Java 21 #4002

Closed
3 tasks done
toco-cam opened this issue Dec 8, 2023 · 10 comments
Closed
3 tasks done

Support for Java 21 #4002

toco-cam opened this issue Dec 8, 2023 · 10 comments
Assignees
Labels
type:feature Issues that add a new user feature to the project. version:7.21.0-alpha4 version:7.21.0

Comments

@toco-cam
Copy link
Member

toco-cam commented Dec 8, 2023

Acceptance Criteria (Required on creation)

  • Java 21 LTS is supported

Hints

Links

Breakdown

Subtasks

  1. 6 of 6
    scope:connect scope:core-api scope:spin scope:template-engines type:subtask version:7.21.0 version:7.21.0-alpha4
    psavidis
  2. 4 of 4
    scope:assert scope:ci scope:core-api scope:documentation scope:external-task-client-java scope:spring-boot scope:webapp type:subtask version:7.21.0 version:7.21.0-alpha4
    psavidis
  3. 1 of 1
    type:subtask version:7.21.0 version:7.21.0-alpha4
    psavidis

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
    • All supported distributions / runtimes / application servers have to be tested with JDK 21
    • Any database vendor can be used during the tests besides h2
      • At least 2 different db vendors for more thorough testing
      • Example: PostgreSQL 13, Microsoft SQL Server 2017
@toco-cam toco-cam added the type:task Issues that are a change to the project that is neither a feature nor a bug fix. label Dec 8, 2023
psavidis added a commit that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-spin that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-spin that referenced this issue Jan 24, 2024
@psavidis
Copy link
Contributor

Java 21 is available as a build environment one Jenkins for the following repositories

  • camunda-bpm-platform

  • camunda-bpm-platform-ee

  • camunda-spin

  • camunda-connect

  • camunda-commons

  • camunda-template-engines-jsr223

psavidis added a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-connect that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-commons that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-connect that referenced this issue Jan 24, 2024
psavidis added a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Jan 24, 2024
@psavidis
Copy link
Contributor

psavidis commented Jan 25, 2024

Kickoff

Context

JDK 21 has been available since 19 September 2023. The scope of this feature is to enable Camunda 7 to support* the new Java version.

What does support mean?

  • The tests of all Camunda 7 Repositories should pass with JDK 21
  • Java 21 should be available as a build environment in the CI
  • camunda-bpm-platform & camunda-bpm-platform-ee builds should pass with JDK 21 on Jenkins under the ci:jdk label build
  • JDBC Drivers should be be compatible with JDK 21

What is not in scope:

  • Incorporating the new features of Java 21 in Camunda 7 codebases
    • This scope is much greater to assess
    • It would break backwards compatibility

Business Value

  • Prolong the life of Camunda 7 Platform by keeping up with the Java Ecosystem
  • Performance improvements done in the new JVM (e.g the new Z Garbage Colllector)
  • This feature will enable our users to use Camunda 7 with Java 21 and benefit from:
    • Features that the new JDK supports (e.g switch pattern matching, text blocks, virtual threads just to name a few)
    • Security Updates
    • Use third party libraries that work with Java 21 together with Camunda 7 platform

Customer Requirements

As a user, i want to be able to use Camunda 7 with Java 21 (OpenJDK & Oracle JDK)

Backwards compatibility

  • All Camunda 7 repositories will continue to work with the current supported JDKs
  • Java 21 will be added as an extension

Documentation

  • There is already a statement for Java 21 Support under the Supported Environment changes under Camunda Platform 7.21 section
  • Add Java 21 under Supported Environments (java, java-runtime)

Backporting

Java 21 Support will be available from 7.21 onwards.

Technical Solution Proposal

Prerequisite

Java 21 is available as a build environment (infra ticket here)

What needs to be added

  • Leverage all* Camunda 7 Components to use Java 21 in their CI stage configuration
    • Both Oracle and OpenJDK should be included

all*: camunda-bpm-rpa-bridge-ee will be considered out-of-scope of the needs of this feature.

Identified Issues

  • [FELIX-6259] JDKs greater than 11 (17 & 21 in our case) require maven-bundle-plugin:5.1.1 to work
  • The class name notation of lambdas in Java 21 changes ; e.g MyClass$$Lambda becomesMyClass$$Lambda$
    • Solution: Change any code that depends on Lambda Class names to consider the new notation conditionally (keep legacy behaviour for previous JDKs and apply new only for versions > JDK 21 )
  • Mockito 4.3.1 does not work with Java 21
    • Side effect: ExternalTaskClientBuilderImplTest#testCustomizeHttpClientExposesInternalHttpClientBuilder fails due to Mockito incompatibility with Java 21.
    • Solution: Update to latest Mockito 5.10.0; Replace mockito-inline maven dependency with mockito-core; see thread here
  • Starting with Mockito 5.0.0, there are discrepancies in the ArgumentMatcher capture expressions (See release notes here)
    • e.g The expressions activityInstanceIdIn(any()) will capture one argument. In the case of vararg calls, the new matching expressions becomes activityInstanceIdIn(any(String[].class))
    • Solution: Replace failing expressions with varargs with the respective expression as indicated in the example above.

Breakdown

Add Java 21 support to sideprojects

  • camunda-spin

  • camunda-connect

  • camunda-commons

  • camunda-template-engines-jsr223

  • feel-scala

  • Upgrade maven-bundle-plugin to version 5.1.1 for all the above repositories

Add Java 21 Support to camunda-bpm-platform components

engine

  • Lambdas in Java 21 change lambda class name notation changes; e.g from MyClass$$Lambda to MyClass$$Lambda$
    • TelemetryDynamicDataTest#shouldNotCollectLambdas fails on Java 21
    • Before Java 21 -> TelemetryDynamicDataTest$$Lambda/0x000000e801492478
    • In Java 21 -> TelemetryDynamicDataTest$$Lambda$202/0x000000012948dcc8
    • Solution: Apply the new check only for Java21 and keep the legacy behaviour for JDKs < 21 (conservative approach instead of checking only for "$$Lambda" suffixes)

Holistic Changes

  • Side effect: ExternalTaskClientBuilderImplTest#testCustomizeHttpClientExposesInternalHttpClientBuilder fails due to Mockito incompatibility with Java 21
    • Solution: Remove mockito-inline from parent pom.xml, Update to version.mockito to 5.10.0
    • Use mockito-core instead
    • This update will fix any other mockito incompatibility problems for all the project
    • Affected modules: All Project Modules that reference mockito-inline
  • Check JDBC Drivers for Java 21 Compatibility for all the Database Integrations

Add Java 21 Support to camunda-bpm-platform-ee

  • ExportProcessInstancesRestServiceTest tests fail with Mockito 5.x.x & Java 21
    • The mock expressions in createVariableInstanceQuery contain varargs and ArgumentMatchers#any() expressions don't work anymore the same.
    • They need to be replaced with ArgumentMatchers#any(String[].class)
    • See the relevant change of the ArgumentMatcher in the release notes of Mockito 5 here

Investigate JDBC compatibility of all supported DBs with JDK 21

  • Lookup in the documentation of the current JDBC Drivers for compatibility issues with the following DB providers:
    • MySQL - Verify latest supported JDBC Driver compatibility with Java 21
    • MariaDB- Verify latest supported JDBC Driver compatibility with Java 21
      • See related ticket with JDBC Driver 1.7.0
      • Attempt to bump the driver during Remove of Supported environments with 7.19 here
      • Issue reported in the forum that got resolved using the driver 1.7
      • MariaDB Connector
    • Oracle 19c- Verify latest supported JDBC Driver compatibility with Java 21
    • IBM DB2- Verify latest supported JDBC Driver compatibility with Java 21
    • PostgreSQL 13 / 14 / 15 / 16- Verify latest supported JDBC Driver compatibility with Java 21
    • Microsoft SQL Server 2017 / 2019- Verify latest supported JDBC Driver compatibility with Java 21
    • H2- Verify latest supported JDBC Driver compatibility with Java 21

psavidis added a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Jan 25, 2024
psavidis added a commit to camunda/camunda-connect that referenced this issue Jan 25, 2024
psavidis added a commit to camunda/camunda-commons that referenced this issue Jan 25, 2024
psavidis added a commit to camunda/camunda-commons that referenced this issue Jan 25, 2024
psavidis added a commit to camunda/camunda-connect that referenced this issue Jan 25, 2024
psavidis added a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Jan 25, 2024
psavidis added a commit to camunda/camunda-connect that referenced this issue Jan 25, 2024
@tasso94 tasso94 added type:feature Issues that add a new user feature to the project. and removed type:task Issues that are a change to the project that is neither a feature nor a bug fix. labels Feb 2, 2024
psavidis added a commit to camunda/docker-camunda-bpm-platform that referenced this issue Mar 11, 2024
- Adjust the README to reflect more accurately the JDK used by each version
- Latest JDK 21 is supported and 7.21 uses JDK 17

Co-authored-by: yanavasileva
Related-to: camunda/camunda-bpm-platform#4002
@gbetances089
Copy link
Member

Test run completed! 🔥

venetrius pushed a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Mar 13, 2024
venetrius pushed a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Mar 13, 2024
venetrius pushed a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Mar 13, 2024
venetrius pushed a commit to camunda/camunda-template-engines-jsr223 that referenced this issue Mar 13, 2024
venetrius pushed a commit that referenced this issue Mar 20, 2024
venetrius pushed a commit that referenced this issue Mar 21, 2024
venetrius pushed a commit that referenced this issue Apr 23, 2024
venetrius pushed a commit that referenced this issue Apr 23, 2024
venetrius pushed a commit that referenced this issue Apr 23, 2024
venetrius pushed a commit that referenced this issue Apr 23, 2024
venetrius pushed a commit that referenced this issue Apr 23, 2024
venetrius pushed a commit that referenced this issue Apr 30, 2024
venetrius pushed a commit that referenced this issue Apr 30, 2024
venetrius pushed a commit that referenced this issue Apr 30, 2024
venetrius pushed a commit that referenced this issue May 2, 2024
venetrius pushed a commit that referenced this issue May 2, 2024
venetrius pushed a commit that referenced this issue May 2, 2024
venetrius pushed a commit that referenced this issue May 2, 2024
venetrius pushed a commit that referenced this issue May 6, 2024
venetrius pushed a commit that referenced this issue May 6, 2024
venetrius pushed a commit that referenced this issue May 6, 2024
venetrius pushed a commit that referenced this issue May 16, 2024
venetrius pushed a commit that referenced this issue May 16, 2024
venetrius pushed a commit that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Issues that add a new user feature to the project. version:7.21.0-alpha4 version:7.21.0
Projects
None yet
Development

No branches or pull requests

5 participants