-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bad dependency for google-cloud-logging
vs google-cloud-datastore
#2050
Comments
Strangely enough, if I checkout from source with the |
Here's the relevant portion of the stack trace we get when we try to use gcloud datastore with gcloud logging:
|
Note that excluding the older 0.4.0 Here's the exception:
|
@janbartel @gregw There is an effort to tackle the dependency conflict issues across the board in the client libs. This is a useful discovery for that effort, but hopefully we're able to resolve it soon. @garrettjonesgoogle PTAL |
@shinfan , I am marking this P0 because datastore and logging can't be used together currently. |
I will take a look. |
I have excluded both This is the dependency section my pom: <dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-logging</artifactId>
<version>1.0.1</version>
<exclusions>
<exclusion>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>1.0.1</version>
<exclusions>
<exclusion>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
<version>0.6.1</version>
</dependency>
</dependencies> You also can view and download the entire sample application here |
@shinfan fyi pubsub has the same problem as logging in that grpc-auth 1.2 uses om.google.auth:google-auth-library-credentials:jar:0.4.0:compile I'm sure a fix in the parent will fix both, but be aware of it. https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-pubsub/pom.xml#L55 |
Similar issue in google-cloud-resourcemanager. It uses v1beta1-rev10 of the client-library and refers to Cloudresourcemanager which is now camel case in all the latest client libraries. Gradle tends to resolve the newer client libraries, so this happens at runtime:
|
googleapis/gax-java#310 should fix the problem. The next released google-cloud-java library should contain the fix. Before that, the workarounds are:
|
@hienle-hps your PR looks reasonable, but it is solving a different issue. Please sign the Contributor License Agreement (the link is in your PR) and then ping anyone from our team and/or assign as reviewers so we can merge your PR. Closing this issue now as the pending PR is not related to it. |
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/auth/Credentials |
I am stuck with similar issue on firebase-admin vs google-cloud-logging-logback. God knows which dependencies are screwing up. Only one of them working at a time. Why Google has messed up so much with the Java libraries ?? |
Please open a new issue with the details of your dependencies so we can help figure out what's happening. |
For https://github.com/GoogleCloudPlatform/jetty-runtime we are trying to use both
google-cloud-logging
andgoogle-cloud-datastore
, but there appears to be incompatible dependencies.With a simple pom like:
we get the following dependency:tree:
Note that 0.4.0 version of
com.google.auth:google-auth-library-oauth2-http:jar
The
google-cloud-datastore
version depends instead on 0.6.1 as you can see in the following dependency:tree:If a pom lists both datastore and logging dependencies, for some reason the 0.4.0 version is picked, which fails to work with datastore (@janbartel can you comment with the exception you are getting).
The text was updated successfully, but these errors were encountered: