I am trying to upload to bigquery from my java app.
Here is my initial code:
import com.google.cloud.bigquery.*;
public class MyClass {
public static void main(String[] args) throws Exception {
BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
}
I am receiving a NoSuchMethodError
error:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.cloud.bigquery.BigQueryOptions.getHttpTransportFactory()Lcom/google/cloud/HttpServiceOptions$HttpTransportFactory;
at com.google.cloud.bigquery.spi.DefaultBigQueryRpc.<init>(DefaultBigQueryRpc.java:83)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:49)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:43)
at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:482)
at com.google.cloud.bigquery.BigQueryImpl.<init>(BigQueryImpl.java:184)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigqueryFactory.create(BigQueryOptions.java:39)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigqueryFactory.create(BigQueryOptions.java:33)
at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:469)
at com.google.cloud.ServiceOptions.service(ServiceOptions.java:463)
How can over come this?
also does this code work the same when running locally, and on app-engine?
I am trying to upload to bigquery from my java app.
Here is my initial code:
import com.google.cloud.bigquery.*;
public class MyClass {
public static void main(String[] args) throws Exception {
BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
}
I am receiving a NoSuchMethodError
error:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.cloud.bigquery.BigQueryOptions.getHttpTransportFactory()Lcom/google/cloud/HttpServiceOptions$HttpTransportFactory;
at com.google.cloud.bigquery.spi.DefaultBigQueryRpc.<init>(DefaultBigQueryRpc.java:83)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:49)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigQueryRpcFactory.create(BigQueryOptions.java:43)
at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:482)
at com.google.cloud.bigquery.BigQueryImpl.<init>(BigQueryImpl.java:184)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigqueryFactory.create(BigQueryOptions.java:39)
at com.google.cloud.bigquery.BigQueryOptions$DefaultBigqueryFactory.create(BigQueryOptions.java:33)
at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:469)
at com.google.cloud.ServiceOptions.service(ServiceOptions.java:463)
How can over come this?
EDIT I am receiving this errror when running locally and also when running on appengine
btw can this code run on app-engine and locally the same?
used google-cloud-bigquery
dependency version 0.5.1
on my pom
should use:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>0.8.0-beta</version>
</dependency>