我的应用程序通过 Twitter 身份验证,并将控制权返回给我的应用程序。但是在搜索推文时,我收到以下错误:
No authentication challenges found Relevant discussions can be
> found on the Internet at: http://www.google.co.jp/search?q=d35baff5
> or http://www.google.co.jp/search?q=12c94143
> TwitterException{exceptionCode=[d35baff5-12c94143 43208640-465ee2e3],
> statusCode=-1, message=null, code=-1, retryAfter=-1,
> rateLimitStatus=null, version=3.0.3} at
> twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:192)
> at
> twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
> at
> twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:81)
> at twitter4j.TwitterImpl.get(TwitterImpl.java:1835) at
> twitter4j.TwitterImpl.search(TwitterImpl.java:282) at
> com.leccion.herencia.Alar$5.run(Alar.java:239) at
> java.lang.Thread.run(Thread.java:864) Caused by: java.io.IOException:
> No authentication challenges found at
> libcore.net.http.HttpURLConnectionImpl.getAuthorizationCredentials(HttpURLConnectionImpl.java:427)
> at
> libcore.net.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:407)
> at
> libcore.net.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:356)
> at
> libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:292)
Y el codigo de mi app es:
final Twitter twitter = TwitterFactory.getSingleton();
twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
twitter.setOAuthAccessToken(accessToken);
final Query query = new Query("source:twitter4j api");
new Thread(new Runnable() {
public void run() {
try {
result = twitter.search(query); ***//el error en esta linea!!!***
for (Status status : result.getTweets())
{
System.out.println("@" + status.getUser().getScreenName() + ":" + status.getText());
}