Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
服务提供商响应错误:301(永久移动)-Twitter API 1.1_Twitter_Twitter4j - Fatal编程技术网

服务提供商响应错误:301(永久移动)-Twitter API 1.1

服务提供商响应错误:301(永久移动)-Twitter API 1.1,twitter,twitter4j,Twitter,Twitter4j,我在尝试连接到Twitter时遇到此错误?为什么? 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

我在尝试连接到Twitter时遇到此错误?为什么?

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

最近也注意到了同样的问题。必须像这样将twitter oauth路径从http更新为https

new DefaultOAuthProvider(
                        "https://api.twitter.com/oauth/request_token",
                        "https://api.twitter.com/oauth/access_token",
                        "https://api.twitter.com/oauth/authorize");

与我一样,您也可能会遇到此问题。如果您在dev.twitter.com上创建应用程序时未将回调Url:添加到应用程序的设置选项卡中的应用程序类型中

这个补丁对我有用。希望对其他遇到同样问题的人有效