I get this error when trying to connect to Twitter? Why?
02-18 16:40:33.270: W/System.err(7167): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved Permanently)
02-18 16:40:33.270: W/System.err(7167): at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:218)
02-18 16:40:33.270: W/System.err(7167): at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:74)
02-18 16:40:33.270: W/System.err(7167): at app.jp.cropnet.twitter.TwitterApp$2.run(TwitterApp.java:255)
02-18 16:40:33.270: W/System.err(7167): Caused by: oauth.signpost.exception.OAuthCommunicationException: Service provider responded in error: 301 (Moved Permanently)
02-18 16:40:33.270: W/System.err(7167): at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:245)
02-18 16:40:33.270: W/System.err(7167): at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:193)
02-18 16:40:33.270: W/System.err(7167): ... 2 more
Noticed same issue recently. Had to update twitter oauth paths from http to https like this
new DefaultOAuthProvider(
"https://api.twitter.com/oauth/request_token",
"https://api.twitter.com/oauth/access_token",
"https://api.twitter.com/oauth/authorize");
You may also suffer with this problem as I. If you didn't add Callback Url: to Application Type in your application's Settings tab when you create application at dev.twitter.com.
This fix works for me. Hope works for others come across same problem.
来源:https://stackoverflow.com/questions/14933160/service-provider-responded-in-error-301-moved-permanently-twitter-api-1-1