Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

fix: make java.base fields accessible to fix java 17 runtime errors. #688

Merged
merged 10 commits into from
Jun 3, 2022

Conversation

mpeddada1
Copy link
Contributor

@mpeddada1 mpeddada1 commented May 31, 2022

Fixes #687

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: oslogin Issues related to the googleapis/java-os-login API. labels May 31, 2022
@mpeddada1
Copy link
Contributor Author

mpeddada1 commented May 31, 2022

Now resulting in the following error locally:

[INFO] Running com.google.cloud.oslogin.v1.it.ITSystemTest
May 31, 2022 2:06:21 PM com.google.auth.oauth2.DefaultCredentialsProvider warnAboutProblematicCredentials
WARNING: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.216 s <<< FAILURE! - in com.google.cloud.oslogin.v1.it.ITSystemTest
[ERROR] com.google.cloud.oslogin.v1.it.ITSystemTest  Time elapsed: 0.216 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.toString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
	at com.google.cloud.oslogin.v1.it.ITSystemTest.getFromCredential(ITSystemTest.java:75)
	at com.google.cloud.oslogin.v1.it.ITSystemTest.setup(ITSystemTest.java:56)

This could be a result of some missing integration test setup on local machine. Testing on the CI.

@mpeddada1
Copy link
Contributor Author

On the CI, we are running into:

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private java.math.BigInteger sun.security.rsa.RSAPrivateCrtKeyImpl.n accessible: module java.base does not "opens sun.security.rsa" to unnamed module @7d907bac
	at com.google.cloud.oslogin.v1.it.ITSystemTest.getFromCredential(ITSystemTest.java:74)
	at com.google.cloud.oslogin.v1.it.ITSystemTest.setup(ITSystemTest.java:56)

@mpeddada1 mpeddada1 marked this pull request as ready for review May 31, 2022 21:13
@mpeddada1 mpeddada1 requested a review from a team as a code owner May 31, 2022 21:13
@mpeddada1 mpeddada1 changed the title fix: java 17 reflection issue fix: make java.base fields accessible to fix java 17 runtime errors. May 31, 2022
@mpeddada1
Copy link
Contributor Author

All checks are now passing.

Copy link
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

Thank you.

@suztomo suztomo merged commit b262f13 into main Jun 3, 2022
@suztomo suztomo deleted the fix-native-17 branch June 3, 2022 16:57
gcf-merge-on-green bot pushed a commit that referenced this pull request Jul 1, 2022
🤖 I have created a release *beep* *boop*
---


## [2.2.0](v2.1.0...v2.2.0) (2022-07-01)


### Features

* Enable REST transport for most of Java and Go clients ([#694](#694)) ([a72656a](a72656a))


### Bug Fixes

* make java.base fields accessible to fix java 17 runtime errors.  ([#688](#688)) ([b262f13](b262f13))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#693](#693)) ([22bd8a0](22bd8a0))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this pull request Jul 1, 2022
🤖 I have created a release *beep* *boop*
---


## [2.2.0](googleapis/java-os-login@v2.1.0...v2.2.0) (2022-07-01)


### Features

* Enable REST transport for most of Java and Go clients ([googleapis#694](googleapis/java-os-login#694)) ([a82410e](googleapis/java-os-login@a82410e))


### Bug Fixes

* make java.base fields accessible to fix java 17 runtime errors.  ([googleapis#688](googleapis/java-os-login#688)) ([51a9a6f](googleapis/java-os-login@51a9a6f))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([googleapis#693](googleapis/java-os-login#693)) ([ecb4469](googleapis/java-os-login@ecb4469))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: oslogin Issues related to the googleapis/java-os-login API. size: s Pull request size is small.
Projects
None yet
2 participants