Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

class com.google.auth.oauth2.UserCredentials cannot be cast to class com.google.auth.oauth2.ServiceAccountCredentials #2142

Closed
dmitry-s opened this issue Jan 27, 2020 · 4 comments · Fixed by #2149

Comments

@dmitry-s
Copy link
Contributor

dmitry-s commented Jan 27, 2020

Describe the bug
IT tests fail with

Caused by: java.lang.ClassCastException: class com.google.auth.oauth2.UserCredentials cannot be cast to class com.google.auth.oauth2.ServiceAccountCredentials (com.google.auth.oauth2.UserCredentials and com.google.auth.oauth2.ServiceAccountCredentials are in unnamed module of loader 'app')
	at com.google.cloud.ServiceOptions$Builder.setCredentials(ServiceOptions.java:221)

Sample

 mvnci -Dit.datastore=true -pl spring-cloud-gcp-data-datastore

The issue is a bug in google-cloud-core:1.92.0 that is pulled from com.google.cloud libraries-bom. The bug was fixed in 1.92.2.

googleapis/java-cloud-bom#271

@meltsufin
Copy link
Contributor

google-cloud-bom doesn't seem to be up to date with the latest releases, and consequently the libraries-bom as well.

cc/ @elharo @suztomo @saturnism

@suztomo
Copy link
Contributor

suztomo commented Jan 27, 2020

Memo: googleapis/java-core#123 is the problem fixed in google-cloud-core:1.92.2.

@meltsufin
Copy link
Contributor

@suztomo how can we ensure that we get such releases quickly into the libraries-bom?

@elharo
Copy link

elharo commented Jan 28, 2020 via email

meltsufin pushed a commit that referenced this issue Feb 7, 2020
This BOM has google-cloud-core 1.92.4.
So it does not need the workaround of #2142 anymore.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants