使用jTwitter for android的授权错误

时间:2013-02-21 15:47:56

标签: android twitter signpost jtwitter

我在我的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)

1 个答案:

答案 0 :(得分:2)

Twitter改变了他们的API。对于oauth网址来说,这是一个微不足道但令人讨厌的变化。

这已在最新版本的JTwitter(2.7)中修复 - 您可以从JTwitter webpage下载