我在一个尺寸为3的小型Ubuntu服务器云中使用Titan,并将Rexster扩展部署到$TITAN_HOME/ext
。但是,如果我尝试调用扩展的端点,我会
{"message":"An error occurred while generating the response object","error":null}
这不是很有帮助。如何获得更详细的输出以查看此处出现的问题?另外,错误null
对我来说似乎很奇怪。什么可以导致它的想法?
修改: 我在整个try-catch-everything块中包含了导致错误的扩展的整个执行:
@ExtensionNaming(
namespace = GraphityExtension.EXT_NAMESPACE,
name = "unfollow")
public class RemoveFollowshipExtension extends GraphityExtension {
@ExtensionDefinition(
extensionPoint = ExtensionPoint.GRAPH)
@ExtensionDescriptor(
description = "Removes a followship between two users.")
public
ExtensionResponse
unfollow(
@RexsterContext RexsterResourceContext content,
@RexsterContext Graph graph,
@ExtensionRequestParameter(
name = "following",
description = "identifier of the user following") String idFollowing,
@ExtensionRequestParameter(
name = "followed",
description = "identifier of the user followed") String idFollowed) {
try {
Graphity graphity = getGraphityInstance((TitanGraph) graph);
Map<String, String> map = new HashMap<String, String>();
try {
map.put(KEY_RESPONSE_VALUE, String.valueOf(graphity
.removeFollowship(idFollowing, idFollowed)));
return ExtensionResponse.ok(new JSONObject(map));
} catch (UnknownFollowingIdException | UnknownFollowedIdException e) {
return ExtensionResponse.error(e);
}
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
return ExtensionResponse.error(sw.toString());
}
}
但继续
{"message":"","error":null}
在客户端。 rexstitan.log
包含有关这些错误的警告:
com.tinkerpop.rexster.GraphResource - The [graphity:unfollow+*] extension raised an error response.
很高兴知道,但不是很详细。
答案 0 :(得分:1)
如果在调用扩展程序期间出现某些故障,通常会收到该错误。通常,运行Rexster的控制台应该提供一些日志消息来解释原因并具有堆栈跟踪。
如果您由于某种原因没有看到这些内容,我会尝试在您的扩展中执行您自己的日志记录,并且可能更频繁地捕获代码中的异常(并记录catch子句),直到您看到错误为止