线程“main”中的异常com.restfb.exception.FacebookResponseStatusException:收到Facebook错误响应(代码1):发生未知错误

时间:2013-10-08 13:50:15

标签: java php facebook-fql restfb jsonobject

我在restfb.com和https://code.google.com/p/restfb/issues/detail?id=8看到了FqlMultiQuery的示例,这些示例涉及单独的查询。

但是,我似乎无法找到关于如何将FqlMultiQuery用于类似查询的示例。类似查询的含义类似于以下模板/示例:

SELECT uid, name FROM user WHERE uid=220439
SELECT uid, name FROM user WHERE uid=239203
SELECT uid, name FROM user WHERE uid=<<iterate_over_this>>

我试图使用FqlMultiQuery来运行类似的查询,并获得一个JsonObject,我可以使用 .toString()输出为JSON。我仍然试了一下,希望事情能奏效。不幸的是,他们没有。

这是RestFB 1.6.12的堆栈:

Exception in thread "main" com.restfb.exception.FacebookResponseStatusException: Received Facebook error response (code 1): An unknown error occurred
  at com.restfb.BaseFacebookClient$DefaultLegacyFacebookExceptionMapper.exceptionForTypeAndMessage(BaseFacebookClient.java:143)
  at com.restfb.BaseFacebookClient.throwLegacyFacebookResponseStatusExceptionIfNecessary(BaseFacebookClient.java:204)
  at com.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:666)
  at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:630)
  at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:592)
  at com.restfb.DefaultFacebookClient.executeFqlMultiquery(DefaultFacebookClient.java:396)
  at com.hadoopfun.facebookanalysissimple.FacebookAnalysisProject.main(FacebookAnalysisProject.java:89)

以下是生成FQL请求和执行FqlMultiQuery的代码:

Map<String, String> queries = new HashMap<String, String>();

for(JsonObject friend : fbUser.getFriends()) {
    String friendId = friend.getString("uid");
    queries.put(friendId, "SELECT post_id, message, type, comment_info, like_info, created_time FROM stream WHERE source_id=" + friendId + " AND actor_id=me() LIMIT 1000");
}

JsonObject multiqueryResults = facebookClient.executeFqlMultiquery(queries, JsonObject.class);

System.out.println(multiqueryResults.toString());

预期产量是多少?我想做什么?

我试图打印出我的查询结果。但是,我得到的是上面粘贴的堆栈中的异常。

0 个答案:

没有答案