GoogleCredentialsProvider$Builder.setUseJwtAccessWithScope not registered for reflection

This issue has been tracked since 2021-09-08.

We are using GraalVM support library 0.5.0 with the Google Cloud Workflows library version 2.0.2 successfully (even though it's not officially supported). When we tried to upgrade the workflows library to 2.0.3 we got the following error at runtime:

java.lang.NoSuchMethodError: com.google.api.gax.core.GoogleCredentialsProvider$Builder.setUseJwtAccessWithScope(boolean)

This was the workflows SDK change:
googleapis/[email protected]v2.0.2...v2.0.3

Relevant bit:

    return GoogleCredentialsProvider.newBuilder()
        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
        .setUseJwtAccessWithScope(true);

Flagging because it seems like it might be a general method that might get used across various SDKs.

We were unable to test it with 0.6.0, so not sure if the above has been resolved in that version.

dzou wrote this answer on 2021-09-09

Hey @kostacasa -- I think this issue is not GraalVM/reflection related but rather an issue with library versions in your stack.

This method com.google.api.gax.core.GoogleCredentialsProvider$Builder.setUseJwtAccessWithScope(boolean) was actually introduced relatively recently here: googleapis/[email protected]ed39c34

From what it looks like, I think cloud workflows library expects a newer version of gax than what may be in your dependency tree right now. The method was introduced in com.google.api:gax in version 2.3.0 (source). Can you run a mvn dependency:tree and confirm that your version of com.google.api:gax is above version 2.3.0?

kostacasa wrote this answer on 2021-09-09

Hi @dzou! You are right, we accidentally explicitly defined the workflow dependency version instead of letting the Google libraries-bom manage it. Our libraries-bom was on v 2.1.0 and so it was pulling in the older (and incompatible) com.google.api:gax.

That said, I can confirm that google-cloud-workflow-executions library seems to work just fine in native mode! I might throw together a quick sample so that you can add it to the compatibility table.

dzou wrote this answer on 2021-09-10

Nice, great to hear you figured out the issue!

I might throw together a quick sample so that you can add it to the compatibility table.

Hey, don't worry about doing this. We're developing a more comprehensive way of testing to validate all the google cloud client libraries in one go. And this will be a much stronger guarantee than the samples approach we've been taking 🙂. Soon we hope to be able to say that "everything just works."

More Details About Repo
Owner Name GoogleCloudPlatform
Repo Name google-cloud-graalvm-support
Full Name GoogleCloudPlatform/google-cloud-graalvm-support
Language Java
Created Date 2020-07-31
Updated Date 2021-09-23
Star Count 43
Watcher Count 13
Fork Count 8
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date