Closed niketan-nath closed 4 weeks ago
Hi @niketan-nath , Can you please post a stack trace?
Hi @PhongChuong, sure. Following is the stack trace:
java.lang.NoSuchMethodError: 'java.lang.Object com.google.common.collect.Iterables.getFirst(java.lang.Iterable, java.lang.Object)'
at com.google.auth.oauth2.OAuth2Credentials.getFromServiceLoader(OAuth2Credentials.java:477)
at com.google.auth.oauth2.UserCredentials.<init>(UserCredentials.java:104)
at com.google.auth.oauth2.UserCredentials.<init>(UserCredentials.java:62)
at com.google.auth.oauth2.UserCredentials$Builder.build(UserCredentials.java:477)
at com.google.auth.oauth2.UserCredentials.fromJson(UserCredentials.java:141)
at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:169)
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentialsUnsynchronized(DefaultCredentialsProvider.java:190)
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:126)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:125)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:97)
at com.google.cloud.ServiceOptions.defaultCredentials(ServiceOptions.java:345)
at com.google.cloud.ServiceOptions.<init>(ServiceOptions.java:310)
at com.google.cloud.bigquery.BigQueryOptions.<init>(BigQueryOptions.java:91)
at com.google.cloud.bigquery.BigQueryOptions.<init>(BigQueryOptions.java:30)
at com.google.cloud.bigquery.BigQueryOptions$Builder.build(BigQueryOptions.java:86)
at com.google.cloud.bigquery.BigQueryOptions.getDefaultInstance(BigQueryOptions.java:161)
at io.harness.adminportal.configuration.BigQueryDataFetch.fetchBQData(BigQueryDataFetch.java:21)
Please let me know if you need any other details. Thanks! 🙌
I don't think this is specific to BigQuery. Can you ask the same question in google-auth-library-java?
Closing this item. Feel free to create a new issue if there are further questions.
Hi everyone,
I'm trying to query a BigQuery dataset from my Java application running on Java 17. I have exported the path to the Service Account Key in my environment. Also, the required workload identity annotations are set up to provide access to the SA for which I have the keys locally.
BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
When I try to execute this line, I get the following error:
java.lang.NoSuchMethodError: 'java.lang.Object com.google.common.collect.Iterables.getFirst(java.lang.Iterable, java.lang.Object)'
I'm using Maven as a build tool and this is what my pom.xml file contains:
I tried adding the Guava dependency separately as well:
Could someone add any pointers on how to proceed further?