所以我正在使用这本O'REILLY书http://tinyurl.com/q7uffb4建立一个微博客安卓应用程序连接到类似Twitter的服务器:http://yamba.marakana.com/使用jtwitter库。
连接服务器:
String username, password;
username = prefs.getString("username", "");
password = prefs.getString("password", "");
twitter = new Twitter(username, password);
twitter.setAPIRootUrl("http://yamba.marakana.com/api");
在我想要获得FriendsTimeline之前一切正常。
getTwitter().getFriendsTimeline();
我得到了
01-16 10:40:33.691: E/UpdaterService(1594): winterwell.jtwitter.TwitterException: java.net.ProtocolException: Too many redirects: 21 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.URLConnectionHttpClient.processError(URLConnectionHttpClient.java:533) 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.URLConnectionHttpClient.connect(URLConnectionHttpClient.java:153) 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.URLConnectionHttpClient.getPage2(URLConnectionHttpClient.java:312) 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.URLConnectionHttpClient.getPage(URLConnectionHttpClient.java:252) 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.Twitter.getStatuses(Twitter.java:1661) 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.Twitter.getUserTimeline(Twitter.java:1775) 01-16 10:40:33.691: E/UpdaterService(1594): at pl.histurion.yamba.UpdaterService$Updater.run(UpdaterService.java:79) 01-16 10:40:33.691: E/UpdaterService(1594): Caused by: java.net.ProtocolException: Too many redirects: 21 01-16 10:40:33.691: E/UpdaterService(1594): at com.android.okhttp.internal.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:439) 01-16 10:40:33.691: E/UpdaterService(1594): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:300) 01-16 10:40:33.691: E/UpdaterService(1594): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503) 01-16 10:40:33.691: E/UpdaterService(1594): at winterwell.jtwitter.URLConnectionHttpClient.processError(URLConnectionHttpClient.java:468) 01-16 10:40:33.691: E/UpdaterService(1594): ... 6 more
我想我完全按照这本书做了一切,所以我不应该犯任何错误。那么服务器呢?我应该开始使用wireshark并尝试找到更低级别的解决方案吗?
答案 0 :(得分:0)
可能对你来说太迟了,但其他人可能会得到帮助。我发现此帖子对类似查询很有用: Alternative for getPublicTimeline for jtwitter