0

我在我的 android 应用程序中使用 jTwitter 库。直到前天一切正常。但是今天出现异常“服务提供商响应错误:301”。请帮助我。

这是堆栈跟踪:

02-21 21:07:27.258: E/AndroidRuntime(4013): FATAL EXCEPTION: AsyncTask #1
02-21 21:07:27.258: E/AndroidRuntime(4013): java.lang.RuntimeException: An error occured while executing doInBackground()
02-21 21:07:27.258: E/AndroidRuntime(4013):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.lang.Thread.run(Thread.java:856)
02-21 21:07:27.258: E/AndroidRuntime(4013): Caused by: winterwell.jtwitter.TwitterException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved Permanently)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at winterwell.jtwitter.OAuthSignpostClient.authorizeUrl(OAuthSignpostClient.java:307)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at com.example.retrieve.contacts.twitter.MainActivity$MyTask.doInBackground(MainActivity.java:363)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at com.example.retrieve.contacts.twitter.MainActivity$MyTask.doInBackground(MainActivity.java:1)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-21 21:07:27.258: E/AndroidRuntime(4013):     ... 5 more
02-21 21:07:27.258: E/AndroidRuntime(4013): Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved Permanently)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at winterwell.jtwitter.OAuthSignpostClient.authorizeUrl(OAuthSignpostClient.java:303)
02-21 21:07:27.258: E/AndroidRuntime(4013):     ... 9 more
02-21 21:07:27.258: E/AndroidRuntime(4013): Caused by: oauth.signpost.exception.OAuthCommunicationException: Service provider responded in error: 301 (Moved Permanently)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:241)
02-21 21:07:27.258: E/AndroidRuntime(4013):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
4

1 回答 1

2

Twitter 改变了他们的 API。这是对 oauth url 的一个微不足道但令人讨厌的更改。

这已在最新版本的 JTwitter (2.7) 中得到修复——您可以从JTwitter 网页下载

于 2013-02-22T11:42:48.447 回答