0

ここからGoogleplusjavaスタータープロジェクトをダウンロードしまし た。mavenをセットアップし、client_idとclient_secret、およびapi_keyを作成して、これらのキーをconfig.propertiesに配置しました。

今、私はプロジェクトを実行し始めました。the

setupTransport()

メソッドは機能しているようです。

しかし、

getProfile() 

メソッドは呼び出され、例外がスローされます。

これは出力です:

Attempting to open a web browser to start the OAuth2 flow
Once you authorize please enter the code here: [entered my Code here]

============== Get my Google+ profile ==============

Okt 16, 2012 1:25:10 PM Sample getProfile
Schwerwiegend: {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
 }
}

Exception in thread "main" java.io.IOException: Stream closed
at java.util.zip.GZIPInputStream.ensureOpen(Unknown Source)
at java.util.zip.GZIPInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at com.google.api.client.http.HttpResponse.parseAsString(HttpResponse.java:464)
at Sample.main(Sample.java:45)

編集:

何が起こったのかわかりませんが、今は機能しています。IDを再度コピーして貼り付け、プロジェクトを更新して、Eclipseに再度ビルドさせました...

4

1 に答える 1

3

ダウンロードページからv5.zipパッケージを使用していますか?もしそうなら、最新バージョンのコードをチェックアウトして、代わりにそれを使用してみてください。

于 2012-10-16T14:25:06.653 に答える