我已从here下载了Google plus java启动项目 我设置了maven,创建了我的client_id和client_secret以及我的api_key,并将这些键放入config.properties。
现在我开始运行该项目。
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再次构建它......