【问题标题】:Twitter4j throws 401 authentication errorsTwitter4j 抛出 401 身份验证错误
【发布时间】:2011-11-05 23:46:10
【问题描述】:

我在尝试使用我自己的凭据访问 Twitter 时收到以下身份验证错误。谁能告诉我可能是什么问题?

401:身份验证凭据 (https://dev.twitter.com/docs/auth) 丢失或不正确。确保您已同步设置有效的消费者密钥/密码、访问令牌/密码和系统时钟。

Tests run: 6, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 4.953 sec <<< FAILURE!
showStatusTest(com.mycompany.twitter.test.TwitterClientTest)  Time elapsed: 0.672 sec  <<< ERROR!
401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
TwitterException{exceptionCode=[6b80c41c-1bd1da85], statusCode=401, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.5-SNAPSHOT(build: 5f9c44cd0e0c1972f8d17653a226b9b6a3392ac2)}
    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:185)
    at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
    at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:93)
    at twitter4j.TwitterImpl.get(TwitterImpl.java:1869)
    at twitter4j.TwitterImpl.showStatus(TwitterImpl.java:445)

【问题讨论】:

    标签: twitter4j


    【解决方案1】:
    401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
    

    通过设置适当的system clock in sync解决了上述异常。

    【讨论】:

    • 什么是系统时钟,如何同步?
    • @Dharmendra - 即系统时钟不同步。不知道您使用的是哪个发行版,但请同步时钟并为我工作。
    • 我必须同步哪个时钟?是系统时钟还是模拟器时钟。您能提供描述吗?
    • @Dharmendra 它只是系统时钟不同步。您只需安装网络时间协议即可解决此问题
    • 答案是部分的,因为即使在使用 NTP 重置时钟后,它也只会消失几分钟然后返回。在 Akka 技术下发生在我身上
    【解决方案2】:

    您是否在应用程序中提供了正确的使用者密钥和访问令牌..?阅读here

    【讨论】:

      猜你喜欢
      • 2012-07-30
      • 2013-05-20
      • 1970-01-01
      • 2016-02-20
      • 1970-01-01
      • 2022-01-06
      • 1970-01-01
      • 1970-01-01
      • 2022-07-04
      相关资源
      最近更新 更多