this evening, I was working on an application that accesses the Twitter API. The developer account for this is @deedee3752 (interesting story behind the name, by now I would have chosen @deedee5502 or so).
With every access, I am checking the rate limit; it never went below 850 remaining requests in the current 15 mins interval.
Nevertheless, I ran into the following exception repeatedly:
2019-03-06 22:57:10.130 ERROR 29108 — [ scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task.
twitter4j.TwitterException: 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.
at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:170) ~[twitter4j-core-4.0.7.jar:4.0.7]
at twitter4j.HttpClientBase.request(HttpClientBase.java:57) ~[twitter4j-core-4.0.7.jar:4.0.7]
at twitter4j.HttpClientBase.get(HttpClientBase.java:75) ~[twitter4j-core-4.0.7.jar:4.0.7]
at twitter4j.TwitterImpl.get(TwitterImpl.java:2084) ~[twitter4j-core-4.0.7.jar:4.0.7]
at twitter4j.TwitterImpl.getUserTimeline(TwitterImpl.java:163) ~[twitter4j-core-4.0.7.jar:4.0.7]
at twitter4j.TwitterImpl.getUserTimeline(TwitterImpl.java:178) ~[twitter4j-core-4.0.7.jar:4.0.7]
at infogralis.twitter.UserTimelineService.scanOneTimeline(UserTimelineService.java:52) ~[main/:na]
I made sure that I have the correct consumerKey, consumerSecret, accessToken and accessTokenSecret. Everything is setup correctly, and it used to work, but now it does not, even after re-generating the accessToken and accessTokenSecret.
I do not think that I abused/hammered the Twitter API with less than 100 accesses over 20 minutes or so, and I should be well within the rate limit.
Could you please help me in determining why the API access suddenly stopped working? Did I do something wrong?
Thanks for your help and support!