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

adservice - Java 19 #1132

Merged
merged 7 commits into from
Nov 29, 2022
Merged

adservice - Java 19 #1132

merged 7 commits into from
Nov 29, 2022

Conversation

mathieu-benoit
Copy link
Contributor

@mathieu-benoit mathieu-benoit commented Oct 3, 2022

Java 18 --> Java 19 for adservice.

Java 19 is now GA https://jdk.java.net/19/release-notes (17 is still the LTS, but for our Online Boutique sample apps I don't see any issue to move to the GA version)

Fixing these 2 CVEs:

@mathieu-benoit mathieu-benoit requested a review from a team as a code owner October 3, 2022 14:49
@mathieu-benoit mathieu-benoit added lang: java Issues specific to Java. status: blocked Resolving the issue is dependent on other work. labels Oct 3, 2022
@mathieu-benoit
Copy link
Contributor Author

mathieu-benoit commented Oct 3, 2022

This PR is to close the one from Renovate #1130, to do complementary updates + tracking a future update we will need to do as soon as Gradle 7.6 is out to support Java 19, like explained here: gradle/gradle#20372.

Current errors in the CI checks:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'app'.
> Could not open cp_proj generic class cache for build file '/app/build.gradle' (/root/.gradle/caches/7.5.1/scripts/astgkvk0vxvanv977lxl570ge).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

Copy link
Member

@bourgeoisor bourgeoisor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, and if we're on 18 we should move to 19, but what was the rationale for moving to 18 in the first place, away from 17 (latest LTS)?

@bourgeoisor
Copy link
Member

Looks like Gradle may need to be bumped, this version is from before 19 being GA:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'app'.
> Could not open cp_proj generic class cache for build file '/app/build.gradle' (/root/.gradle/caches/7.5.1/scripts/astgkvk0vxvanv977lxl570ge).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

@NimJay NimJay added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Oct 3, 2022
@NimJay NimJay added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Oct 21, 2022
@NimJay NimJay added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Nov 22, 2022
@mathieu-benoit mathieu-benoit self-assigned this Nov 29, 2022
@mathieu-benoit
Copy link
Contributor Author

mathieu-benoit commented Nov 29, 2022

Gradle 7.6 is now out and the CI pipeline is leveraging it now: #1302.

Now the issue is at runtime:

- pr1132:pod/adservice-6f5558599b-mg685: container server terminated with exit code 1
      > [adservice-6f5558599b-mg685 server] Could not create logging file: Read-only file system
      > [adservice-6f5558599b-mg685 server] COULD NOT CREATE A LOGGINGFILE 20221129-144421.1!Could not create logging file: Read-only file system
      > [adservice-6f5558599b-mg685 server] COULD NOT CREATE A LOGGINGFILE 20221129-144421.1!Error: LinkageError occurred while loading main class hipstershop.AdService
      > [adservice-6f5558599b-mg685 server] 	java.lang.UnsupportedClassVersionError: hipstershop/AdService has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 62.0
 - pr1132:deployment/adservice failed. Error: container server terminated with exit code 1.

@github-actions
Copy link

🚲 PR staged at http://35.223.27.27

@mathieu-benoit
Copy link
Contributor Author

mathieu-benoit commented Nov 29, 2022

Finally, I just needed to resolve this hipstershop/AdService has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 62.0 by using the same version for the 2 stages in the Dockerfile.

Looks like we are now ready to have Java 19 (STS - GA), but your call @NimJay to say if you want it in main branch. Context: 17 is still the LTS, and we are already in 18, moving to 19 fixes 2 CVEs.

@mathieu-benoit mathieu-benoit added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed status: blocked Resolving the issue is dependent on other work. labels Nov 29, 2022
@NimJay NimJay removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 29, 2022
@NimJay
Copy link
Collaborator

NimJay commented Nov 29, 2022

I think newer the version, the better — as long as there's support and it's stable/GA.
So 19 sounds good to me. :)

Thanks, Olivier and Mathieu, for your input.
And thanks, Mathieu, for fixing the issues!

@NimJay NimJay merged commit db91676 into main Nov 29, 2022
@NimJay NimJay deleted the mathieu-benoit/java-19 branch November 29, 2022 17:49
D-Mwanth pushed a commit to D-Mwanth/microservices-demo that referenced this pull request Mar 6, 2024
Co-authored-by: minherz <minherz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: java Issues specific to Java.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants