-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
I'm trying to use BQ Data transfer client just to list supported data sources as an example but I'm seeing this error:
"java.lang.NoClassDefFoundError: Could not initialize class com.google.cloud.bigquery.datatransfer.v1.stub.GrpcDataTransferServiceStub"
This is my pom:
com.google.cloud
google-cloud-bigquerydatatransfer
0.55.1-beta
com.google.protobuf
protobuf-java
3.1.0
This is the sample code:
Credentials credentials = GoogleCredentials
.fromStream(new FileInputStream(credsFile));
// googleCloudStorage = StorageOptions.newBuilder().setCredentials(credentials)
// .setProjectId(projectId).build().getService();
DataTransferServiceSettings transferServiceSettings = DataTransferServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credentials))
.build();
// Instantiate a client. If you don't specify credentials when constructing a client, the
// client library will look for credentials in the environment, such as the
// GOOGLE_APPLICATION_CREDENTIALS environment variable.
try (DataTransferServiceClient client = DataTransferServiceClient.create(transferServiceSettings)) {
// Request the list of available data sources.
String parent = String.format("projects/%s", projectId);
ListDataSourcesRequest request =
ListDataSourcesRequest.newBuilder()
.setParent(parent)
.build();
ListDataSourcesPagedResponse response = client.listDataSources(request);It throws error at the line where dts client is initialized:
DataTransferServiceClient.create(transferServiceSettings)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.