I was able to reproduce the said exception using JTwitter 2.9.0. Reason for my earlier suggestion was:
List<winterwell.jtwitter.Status> timeline;
I was using a modified version of JTwitter library: JTwitterYamba
. This library does not contain winterwell.jtwitter.Status
. Instead Status
is an inner class defined in winterwell.jtwitter.Twitter
making its fully qualified path: winterwell.jtwitter.Twitter.Status
.
List<winterwell.jtwitter.Twitter.Status> timeline;
So, instead of asking you to lose JTwitter jar and add JTwitterYamba jar, I suggested the exact opposite. Sorry about the confusion.
The problem:
Both libraries implement Twitter.getFriendsTimeline()
differently. Here's what JTwitterYamba does:
public List<Status> getFriendsTimeline() throws TwitterException {
// Take note of the URL suffix: /statuses/friends_timeline.json
return getStatuses(TWITTER_URL + "/statuses/friends_timeline.json",
standardishParameters(), true);
}
And, here's what JTwitter does:
@Deprecated
public List<Status> getFriendsTimeline() throws TwitterException {
return getHomeTimeline();
}
public List<Status> getHomeTimeline() throws TwitterException {
assert http.canAuthenticate();
// The URL isn't the same
return getStatuses(TWITTER_URL + "/statuses/home_timeline.json",
standardishParameters(), true);
}
What you can do to fix this:
You can remove JTwitter from your project and add JTwitterYamba jar: Link. You will have to change winterwell.jtwitter.Status
to winterwell.jtwitter.Twitter.Status
.
Alternatively, you can check if modifying the library is allowed and possible for you. Add a public method that uses TWITTER_URL + "/statuses/friends_timeline.json"
as one of the arguments for Twitter.getStatuses
method.