Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

APIs requires auth dependencies to work correctly #2192

Closed
jabubake opened this issue Jun 27, 2017 · 15 comments
Closed

APIs requires auth dependencies to work correctly #2192

jabubake opened this issue Jun 27, 2017 · 15 comments
Assignees
Labels
api: clouderrorreporting Issues related to the Error Reporting API. api: dlp Issues related to the Sensitive Data Protection API. api: language Issues related to the Cloud Natural Language API API. api: monitoring Issues related to the Cloud Monitoring API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@jabubake
Copy link
Contributor

jabubake commented Jun 27, 2017

Using only com.google.cloud:google-cloud-errorreporting:0.20-alpha :

java.lang.NoClassDefFoundError: com/google/auth/ServiceAccountSigner
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:549)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:475)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:428)
	at com.google.api.gax.core.GoogleCredentialsProvider.getCredentials(GoogleCredentialsProvider.java:54)
	at com.google.api.gax.grpc.InstantiatingChannelProvider.createChannel(InstantiatingChannelProvider.java:125)
	at com.google.api.gax.grpc.InstantiatingChannelProvider.getChannel(InstantiatingChannelProvider.java:116)
	at com.google.api.gax.grpc.ChannelAndExecutor.create(ChannelAndExecutor.java:65)
	at com.google.api.gax.grpc.ClientSettings.getChannelAndExecutor(ClientSettings.java:91)
	at com.google.cloud.errorreporting.v1beta1.ReportErrorsServiceClient.<init>(ReportErrorsServiceClient.java:122)

Current workaround is to include :

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.auth</groupId>
        <artifactId>google-auth-library-credentials</artifactId>
        <version>0.6.1</version>
      </dependency>
      <dependency>
        <groupId>com.google.auth</groupId>
        <artifactId>google-auth-library-oauth2-http</artifactId>
        <version>0.6.1</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
@jabubake jabubake added the api: clouderrorreporting Issues related to the Error Reporting API. label Jun 27, 2017
@jabubake jabubake changed the title google-cloud-errorreporting requires auth dependencies for local testing google-cloud-errorreporting requires auth dependencies to work correctly Jun 27, 2017
@jabubake jabubake changed the title google-cloud-errorreporting requires auth dependencies to work correctly google-cloud-errorreporting requires auth dependencies to work correctly Jun 27, 2017
@shinfan
Copy link
Contributor

shinfan commented Jun 27, 2017

@jabubake Is this a documentation issue or something needs to be changed in the pom?

@shinfan shinfan added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jun 27, 2017
@shinfan
Copy link
Contributor

shinfan commented Jun 27, 2017

This sounds like a severe issue I will mark this as P1

@jabubake
Copy link
Contributor Author

in the pom.

@jabubake
Copy link
Contributor Author

Same is true for google-cloud-language as well.

@jabubake jabubake added the api: language Issues related to the Cloud Natural Language API API. label Jun 27, 2017
@jabubake
Copy link
Contributor Author

FYI, @gguuss @lesv

@jabubake jabubake changed the title google-cloud-errorreporting requires auth dependencies to work correctly APIs requires auth dependencies to work correctly Jun 27, 2017
@jabubake
Copy link
Contributor Author

@garrettjonesgoogle FYI

@gguuss
Copy link
Contributor

gguuss commented Jun 27, 2017

I went ahead and put together a PR to include the auth dependency.

@gguuss
Copy link
Contributor

gguuss commented Jul 6, 2017

Once this issue resolves, we'll need to update the language sample's POM.

@jabubake
Copy link
Contributor Author

@neozwu : DLP API as well.

@garrettjonesgoogle garrettjonesgoogle added the api: dlp Issues related to the Sensitive Data Protection API. label Jul 17, 2017
@garrettjonesgoogle
Copy link
Member

I believe the root cause is that Maven is making a bad, bad choice when resolving this dependency. If maven used the latest version in the tree (which Gradle does), we would not be seeing this issue; we do indeed have the latest version in the dependency tree.

@lesv
Copy link
Contributor

lesv commented Jul 18, 2017

mvn dependency:tree -Dverbose
https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html

It sounds like something is listed twice and picking the wrong one.

@garrettjonesgoogle
Copy link
Member

Potentially we could subvert Maven's dependency choice by putting the google-auth-library-java dependency in google-cloud-core-grpc. We would have to experiment and see if that fixes the problem.

@neozwu
Copy link
Contributor

neozwu commented Jul 25, 2017

I'm working on migrating from maven to gradle. This would be something the migration should take care of.

@garrettjonesgoogle
Copy link
Member

Consumers of google-cloud-java using Maven will likely still hit this issue even if we are using Gradle.

@jabubake
Copy link
Contributor Author

@neozwu : +1 to what @garrettjonesgoogle just said.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
api: clouderrorreporting Issues related to the Error Reporting API. api: dlp Issues related to the Sensitive Data Protection API. api: language Issues related to the Cloud Natural Language API API. api: monitoring Issues related to the Cloud Monitoring API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

7 participants