FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

deps: added temp fix for auth by munkhuushmgl · Pull Request #3542 · GoogleCloudPlatform/java-docs-samples · GitHub

deps: added temp fix for auth - #3542

Merged
lesv merged 1 commit into
masterfrom
temp-fix-monitor
Aug 14, 2020
Merged

deps: added temp fix for auth#3542
lesv merged 1 commit into
masterfrom
temp-fix-monitor

Conversation

Copy link
Copy Markdown
Contributor

Fixes #3540

I am not sure it is really good solution for this issue. I was able to make it pass adding the removed deps from previous PR.

  • Please merge this PR for me once it is approved.

munkhuushmgl requested review from a team and lesv August 14, 2020 17:29
google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 14, 2020

lesv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@elharo FYI

lesv commented Aug 14, 2020

Copy link
Copy Markdown
Contributor

Seems to have an issue.

Copy link
Copy Markdown
Contributor Author

looks like it is flaky

munkhuushmgl added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 14, 2020
kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 14, 2020

Copy link
Copy Markdown
Member

I don't understand how this is failing. If you run mvn dependency:list or mvn dependency:tree in the monitoring/cloud-client directory in #3534, it already shows it's resolving to 0.21.1 for google-auth-library-credentials and google-auth-library-oauth2-http

Copy link
Copy Markdown
Contributor Author

I don't understand how this is failing. If you run mvn dependency:list or mvn dependency:tree in the monitoring/cloud-client directory in #3534, it already shows it's resolving to 0.21.1 for google-auth-library-credentials and google-auth-library-oauth2-http

I do not have enough context on this, but when I upgrade to bom to 9.0.0 --> it fails with the following error:

java.lang.NoClassDefFoundError: com/google/auth/oauth2/ServiceAccountJwtAccessCredentials

	at com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings.defaultCredentialsProviderBuilder(MetricServiceStubSettings.java:216)
	at com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings$Builder.createDefault(MetricServiceStubSettings.java:587)
	at com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings$Builder.access$000(MetricServiceStubSettings.java:471)
	at com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings.newBuilder(MetricServiceStubSettings.java:240)
	at com.google.cloud.monitoring.v3.MetricServiceSettings$Builder.createDefault(MetricServiceSettings.java:208)
	at com.google.cloud.monitoring.v3.MetricServiceSettings$Builder.access$000(MetricServiceSettings.java:198)
	at com.google.cloud.monitoring.v3.MetricServiceSettings.newBuilder(MetricServiceSettings.java:180)
	at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:130)
	at com.example.monitoring.QuickstartSample.main(QuickstartSample.java:51)
	at com.example.monitoring.QuickstartSampleIT.testQuickstart(QuickstartSampleIT.java:63)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: java.lang.ClassNotFoundException: com.google.auth.oauth2.ServiceAccountJwtAccessCredentials
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 37 more

Copy link
Copy Markdown
Member

Yeah, I see the error, but I'm not seeing why specifying the version here would fix it. Does it work without the version numbers?

Copy link
Copy Markdown
Contributor Author

Yeah, I see the error, but I'm not seeing why specifying the version here would fix it. Does it work without the version numbers?

It does work without the version number also:

    <!-- FIXME: remove after client fixes depenency issue => BOM 9.0.0   -->
    <dependency>
      <groupId>com.google.auth</groupId>
      <artifactId>google-auth-library-credentials</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.auth</groupId>
      <artifactId>google-auth-library-oauth2-http</artifactId>
    </dependency>

Copy link
Copy Markdown
Member

Ok I figured it out - it's the interaction with the maven-flatten-plugin: google-cloud-monitoring declares google-auth-library-oauth2-http as a test dependency (which it is as far as the code in the client library). It normally gets the google-auth-library-oauth2-http library via gax, but maven-flatten-plugin is excluding it because the client library pom declares that artifact. It's stripped out of the flattened pom because it's a test dependency.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitoring breaks w/ Libraries-BOM 9.0.0

4 participants


Back | FazBrowse Home | New Git URL