GeezerVison is showing github.com — BiQuery query method results in java.lang.NoSuchMethodError · Issue #2418 · googleapis/google-cloud-java
BiQuery query method results in java.lang.NoSuchMethodError #2418
Description
I am creating a simple Query against a big query table, however I cannot seem to actually send the query due to an issue with QueryJobConfiguration throwing a java.lang.NoSuchMethodError when it tries to use getQueryParameters(). In fact, looking at the downloaded sources, there seems to be missing dependencies, with my IDE not being able to find com.google.api.services.bigquery.model.QueryParameter in general
I am using the following version of gcloud SDK for java
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>0.22.0-beta</version>
</dependency>
The Truncated error
Caused by: java.lang.NoSuchMethodError: com.google.api.services.bigquery.model.JobConfigurationQuery.getQueryParameters()Ljava/util/List;
at com.google.cloud.bigquery.QueryJobConfiguration$Builder.<init>(QueryJobConfiguration.java:135)
at com.google.cloud.bigquery.QueryJobConfiguration$Builder.<init>(QueryJobConfiguration.java:85)
at com.google.cloud.bigquery.QueryJobConfiguration.fromPb(QueryJobConfiguration.java:813)
at com.google.cloud.bigquery.JobConfiguration.fromPb(JobConfiguration.java:140)
at com.google.cloud.bigquery.JobInfo$BuilderImpl.<init>(JobInfo.java:184)
at com.google.cloud.bigquery.Job.fromPb(Job.java:307)
at com.google.cloud.bigquery.BigQueryImpl.query(BigQueryImpl.java:595)
at com.google.cloud.bigquery.BigQueryImpl.query(BigQueryImpl.java:567)
Activity
michaelbausor commented on Sep 8, 2017
Hi @patmagee, can you provide a bit more info about how to reproduce the issue? When I create a new project using maven and depend only on the google-cloud-bigquery:0.22.0-beta package I am not seeing a NoSuchMethodError.
Thanks!
patmagee commented on Sep 11, 2017
@michaelbausor We are using this within a webapp and the code is within a deplotyed WAR on a widlfly server. Right now this only seems to be an issue when I am NOT using a Legacy SQL query (Ideally i was hoping to used parameterized queries). It appears I can use legacy queries. Right now I am using the QueryRequestBuilder to create a new request (without the parameters). I am doing something similar to the following:
String myQuery = "From .......";
QueryRequest qr = QueryRequest.newBuilder(myQuery).setUseLegacySql(false).build();
QueryResponse response = bigQuery.query(qr);
while (!response.jobCompleted()) {
Thread.sleep(1000L);
response = bigQuery.getQueryResults(response.getJobId());
}
return response.getResult();
Looking in the resulting War, these are the dependencies resolved from google-cloud-bigquery:0.22.0-beta.
google-api-client-1.22.0.jar
google-api-services-bigquery-v2-rev315-1.22.0.jar
google-auth-library-credentials-0.7.0.jar
google-auth-library-oauth2-http-0.7.0.jar
google-cloud-bigquery-0.22.0-beta.jar
google-cloud-core-1.4.0.jar
google-cloud-core-http-1.4.0.jar
google-http-client-1.22.0.jar
google-http-client-appengine-1.22.0.jar
google-http-client-jackson-1.22.0.jar
google-http-client-jackson2-1.22.0.jar
google-oauth-client-1.22.0.jar
patmagee commented on Sep 11, 2017
This was a dependency issue. Someone was using an old version of the API elsewhere that was not documented
Metadata
Metadata
Development
No branches or pull requestsIssue actions