简体   繁体   中英

Twitter4j: Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect

I am creating a program to search for tweets having a given keyword using Twitter4j API but I am getting the error during authentication:

Exception in thread "main" 401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
message - Invalid or expired token.
code - 89

Relevant discussions can be found on the Internet at:
    http://www.google.co.jp/search?q=506c3b98 or
    http://www.google.co.jp/search?q=1136695b
TwitterException{exceptionCode=[506c3b98-1136695b], statusCode=401, message=Invalid or expired token., code=89, retryAfter=-1, rateLimitStatus=null, version=4.0.4}

I verified all the tokens in my twitter4j.properties file and tried all the possible solutions mentioned in SO site but they didn't worked for me. I have spent hours to correct the error but am still clueless what's the problem ?

Actually the problem was, I added all the jars which comes with Twitter4j API in my build path library. I just removed all other jars except twitter4j-core-4.0.4.jar and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM