GData Java客户端无法工作,因为Google重定向到本地化站点
我在跟踪文档 我得到了GData Java客户端无法工作,因为Google重定向到本地化站点,java,gdata,google-analytics-api,Java,Gdata,Google Analytics Api,我在跟踪文档 我得到了RedirectRequiredException异常,因为谷歌 正在将我重定向到该网站的本地版本(www.google.si) 守则: AnalyticsService as = new AnalyticsService("me-myapp-1.0"); as.setUserCredentials(username, password); AccountFeed accountFeed = as.getFeed( new URL("https://www.g
RedirectRequiredException
异常,因为谷歌
正在将我重定向到该网站的本地版本(www.google.si)
守则:
AnalyticsService as = new AnalyticsService("me-myapp-1.0");
as.setUserCredentials(username, password);
AccountFeed accountFeed = as.getFeed(
new URL("https://www.google.com/analytics/accounts/default"),
AccountFeed.class);
最后一个方法调用抛出:
Exception in thread "main" com.google.gdata.util.RedirectRequiredException: Found
<HTML><HEAD><meta http-equiv="content-type" content="text/
html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.si/">here</A>.
</BODY></HTML>
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse (GoogleGDataRequest.java:541)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse (HttpGDataRequest.java:535)
at com.google.gdata.client.http.HttpGDataRequest.execute (HttpGDataRequest.java:514)
at com.google.gdata.client.http.GoogleGDataRequest.execute (GoogleGDataRequest.java:515)
at com.google.gdata.client.Service.getFeed(Service.java:1016)
at com.google.gdata.client.Service.getFeed(Service.java:879)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:638)
at com.google.gdata.client.Service.getFeed(Service.java:898)
at org.kubje.jaka.gapump.App.main(App.java:42)
线程“main”com.google.gdata.util.RedirectRequiredException中的异常:已找到
302移动
302移动
文档已移动
.
位于com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:541)
位于com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:535)
位于com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:514)
位于com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:515)
位于com.google.gdata.client.Service.getFeed(Service.java:1016)
位于com.google.gdata.client.Service.getFeed(Service.java:879)
位于com.google.gdata.client.GoogleService.getFeed(GoogleService.java:638)
位于com.google.gdata.client.Service.getFeed(Service.java:898)
位于org.kubje.jaka.gapump.App.main(App.java:42)
有什么想法吗
我还将此问题发布到了Analytics API的Google Group上。URL不正确。我从示例中复制了它,这是不正确的。URL不正确。我从示例中复制了它,这是不正确的