我有一个程序将涉及使用com.google.gcloud:gcloudjava:0.1.4
默认BigQueryOptions
配置频繁访问 BigQuery
但是有时我遇到堆栈跟踪错误,如下所示
Caused by: java.io.IOException: Error getting access token for service account:
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:227)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:97)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:74)
at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:65)
at com.google.gcloud.ServiceOptions$1.initialize(ServiceOptions.java:533)
at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:300)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.gcloud.spi.DefaultBigQueryRpc.query(DefaultBigQueryRpc.java:402)
它只是不时失败,但我想知道是否有任何方法可以提高程序的稳定性。因此,以防万一我想知道,这是一个纯粹的服务器端问题,我无法解决它,或者我有什么办法可以在客户端降低发生这种情况的可能性(比如通过更改身份验证配置还是什么?)