奇怪的Twitter4J错误 - “JSONObject [”坐标“]不是字符串。”

时间:2013-07-03 21:03:03

标签: java swing twitter4j

我正在网站上使用此代码示例来搜索库中的特定短语。

Twitter twitter = TwitterFactory.getSingleton();
Query query = new Query("source:twitter4j yusukey");
QueryResult result = twitter.search(query);
for (Status status : result.getTweets()) {
    System.out.println("@" + status.getUser().getScreenName() + ":" + status.getText());
}

但是,我似乎得到了Twitter例外:

JSONObject["coordinates"] not a string.
Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=8c005e6e or
http://www.google.co.jp/search?q=c45cf3de
TwitterException{exceptionCode=[8c005e6e-c45cf3de 8c005e6e-c45cf3d6], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.0}
at twitter4j.internal.json.z_T4JInternalJSONImplFactory.createGeoLocation(z_T4JInternalJSONImplFactory.java:96)
at twitter4j.internal.json.StatusJSONImpl.init(StatusJSONImpl.java:110)
at twitter4j.internal.json.StatusJSONImpl.<init>(StatusJSONImpl.java:76)
at twitter4j.internal.json.QueryResultJSONImpl.<init>(QueryResultJSONImpl.java:87)
at twitter4j.internal.json.z_T4JInternalJSONImplFactory.createQueryResult(z_T4JInternalJSONImplFactory.java:155)
at twitter4j.TwitterImpl.search(TwitterImpl.java:260)
at GrammarChecker.checkStatuses(GrammarChecker.java:70)
at GrammarChecker$1.actionPerformed(GrammarChecker.java:42)
at java.awt.Button.processActionEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

指示的行号指向调用“twitter.search(query)”。

有没有人有任何想法?

1 个答案:

答案 0 :(得分:0)

我似乎已经通过更新库修复了问题 - 我之前运行的是3.0。应该使用最新版本(目前3.0.3)。