BigQuery未拾取java中的属性集

BigQuery未拾取java中的属性集,java,google-bigquery,Java,Google Bigquery,我正在尝试连接到一台需要所有流量通过代理的机器上的BigQuery。我已经在Java和命令行中设置了http.proxyHost和http.proxyPort系统变量,但总是出现以下错误: com.google.cloud.bigquery.BigQueryException: Error getting access token for service account: Read timed out at com.google.cloud.bigquery.spi.v2.HttpBigQue

我正在尝试连接到一台需要所有流量通过代理的机器上的BigQuery。我已经在Java和命令行中设置了http.proxyHost和http.proxyPort系统变量,但总是出现以下错误:

com.google.cloud.bigquery.BigQueryException: Error getting access token for service account: Read timed out
 at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.translate(HttpBigQueryRpc.java:106)
        at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.create(HttpBigQueryRpc.java:206)
        at com.google.cloud.bigquery.BigQueryImpl$5.call(BigQueryImpl.java:319)
        at com.google.cloud.bigquery.BigQueryImpl$5.call(BigQueryImpl.java:316)
        at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
        at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
        at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
        at com.google.cloud.bigquery.BigQueryImpl.create(BigQueryImpl.java:315)
        at com.google.cloud.bigquery.BigQueryImpl.create(BigQueryImpl.java:290)
        at com.ad.google.bigquery.GoogleBigQuery.runGBQQuery_CCPA(GoogleBigQuery.java:172)
        at com.ad.gogbq.test.Tester_GBQ.runQuery(Tester_GBQ.java:62)
        at com.ad.gogbq.test.Tester_GBQ.main(Tester_GBQ.java:274)
Caused by: java.io.IOException: Error getting access token for service account: Read timed out
        at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:432)
        at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
        at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
        at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:91)
        at com.google.cloud.http.HttpTransportOptions$1.initialize(HttpTransportOptions.java:159)
        at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:88)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:430)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:549)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:482)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:599)
        at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.create(HttpBigQueryRpc.java:204)
        ... 10 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
        at sun.security.ssl.InputRecord.read(InputRecord.java:503)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259)
        at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:108)
        at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:79)
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:995)
        at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:429)

我已经成功地使用上述系统变量打开并阅读了相关机器上的网页。BigQuery似乎没有使用这些变量,我想知道是否有其他人看到了这一点?

在您的问题中,似乎您正在设置
http.*
properties,因为所有Google API访问都是通过HTTPS进行的,请确保您设置了以下两个属性:

System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "3128");

查看更多信息。

在您的问题中,似乎您正在设置
http.*
属性,因为所有Google API访问都是通过HTTPS进行的,请确保您设置了以下两个属性:

System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "3128");
更多信息请参见