Environment details
- Specify the API at the beginning of the title. For example, "BigQuery: ...").
General, Core, and Other are also allowed as types
- OS type and version: MAC OS Big Sur 11.5.2
- Java version: 8
- google-auth-library version(s): 1.1.0
Steps to reproduce
- Impersonate the account : gcloud config set auth/impersonate_service_account
- Set application default credentials : gcloud auth application-default login
Code example
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.bigquery.BigQuery;
GoogleCredentials credentials = ComputeEngineCredentials.getApplicationDefault();
BigQuery bigquery = BigQueryOptions.newBuilder().setProjectId(projectId).setCredentials(credentials).build()
.getService();
// example
Stack trace
Caused by: java.lang.ClassCastException: class com.google.common.collect.SingletonImmutableSet cannot be cast to class java.util.List (com.google.common.collect.SingletonImmutableSet is in unnamed module of loader 'app'; java.util.List is in module java.base of loader 'bootstrap')
at com.google.auth.oauth2.ImpersonatedCredentials.createScoped(ImpersonatedCredentials.java:367)
at com.google.cloud.ServiceOptions.getScopedCredentials(ServiceOptions.java:596)
at com.google.cloud.http.HttpTransportOptions.getHttpRequestInitializer(HttpTransportOptions.java:145)
at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.<init>(HttpBigQueryRpc.java:105)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:56)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:50)
at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:560)
at com.google.cloud.bigquery.BigQueryOptions.getBigQueryRpcV2(BigQueryOptions.java:125)
at com.google.cloud.bigquery.BigQueryImpl.<init>(BigQueryImpl.java:249)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryFactory.create(BigQueryOptions.java:46)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryFactory.create(BigQueryOptions.java:40)
at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:540)
External references such as API reference guides
Any additional information below
Environment details
General, Core, and Other are also allowed as types
Steps to reproduce
Code example
Stack trace
External references such as API reference guides
Any additional information below