“线程中的异常”主“java.net.ConnectException:连接被拒绝:连接后”输入网址提供的OAuth代码

时间:2013-02-15 08:49:15

标签: google-bigquery

我是BigQuery的新手,我想在我的java类中使用bigquery。我有一个URL来授权BigQuery Access,我也从url获得了权限代码,但是当我在我的代码中使用这个权限代码时,我得到了以下错误。

将此URL粘贴到Web浏览器中以授权BigQuery Access: https://accounts.google.com/o/oauth2/auth?client_id=488768089408.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/bigquery&state ...并输入您在此处收到的代码: 4 / -P5SeVJsfX8hcztKa_spJdqcP6XH.ovCNnaPn5t4SOl05ti8ZT3a9jBS6eQI 线程“main”中的异常java.net.ConnectException:连接被拒绝:连接     at java.net.PlainSocketImpl.socketConnect(Native Method)     在java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)     在java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)     在java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)     在java.net.Socket.connect(Socket.java:519)     在sun.net.NetworkClient.doConnect(NetworkClient.java:152)     在sun.net.www.http.HttpClient.openServer(HttpClient.java:388)     在sun.net.www.http.HttpClient.openServer(HttpClient.java:500)     在sun.net.www.protocol.https.HttpsClient。(HttpsClient.java:271)     在sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:328)     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:176)     在sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:733)     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:162)     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)     在com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:84)     在com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)     在com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:299)     在com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.execute(GoogleAuthorizationCodeTokenRequest.java:175)     在com.ymsli.client.BigQueryJavaGettingStarted.exchangeCode(BigQueryJavaGettingStarted.java:250)     在com.ymsli.client.BigQueryJavaGettingStarted.createAuthorizedClient(BigQueryJavaGettingStarted.java:110)     在com.ymsli.client.BigQueryJavaGettingStarted.main(BigQueryJavaGettingStarted.java:68)

请帮帮我。

提前致谢 Shri Kant

1 个答案:

答案 0 :(得分:2)

这看起来很像潜在的防火墙问题。你的应用程序在哪里运行?它是否可以访问网络和HTTPS(端口443)?