无法加载我刚刚保存的 GraphML 文件

Cannot load the GraphML file I just saved

我正在使用 Gremlin 服务器。

我将数据库的内容保存在 XML 文件 (GraphML) 中,其中包含以下行:

g.io(path).write().iterate()

我使用这一行加载文件:

g.io(path).read().iterate();

然后我得到这个错误:

connection.js:282
        new ResponseError(util.format('Server error: %s (%d)', response.status.message, response.status.code), response.status));
        ^
ResponseError: Server error: For input string: "-2555865115" (500)

此错误来自 gremlin 服务器。

如果我在 XML 文件中搜索此值 (-2555865115) 并删除最后一个字符 (-255586511),那么问题就解决了。

为什么会这样?我该如何解决这个问题?数据库总是保存一个我必须手动修复的文件。

如果我必须更改 Gremlin Server 的配置文件中的某些内容,您能告诉我要修改哪个文件以及如何修改吗?因为我以前从来没有这样做过。

我在本地计算机上使用 Gremlin 服务器只是为了测试,没有任何更改。

编辑:

我将 conf/tinkergraph-empty.properties 更改为:

gremlin.tinkergraph.vertexIdManager=ANY
gremlin.tinkergraph.edgeIdManager=ANY
gremlin.tinkergraph.vertexPropertyIdManager=ANY

我重新启动了,但在加载 XML 文件时出现同样的错误。

鉴于从您的数值中删除最后一个整数解决了问题,我推测您达到了极限;具体来说,整数可以具有的最低值。

In Java, that value is -2147483647, and that happens to be the language that the default implementation of Gremlin Server 已写入。因此,反序列化过程可能在尝试将该值解释为整数时失败。由于该值低于整数的最小值,并且由于错误消息谈到它是一个输入字符串,因此 Integer.parseInt("-2555865115") 可能是在幕后失败的调用。

如果 Gremlin 同时对数据进行序列化和反序列化,则可能是该实现中的一个错误,您可能希望 file an issue. In the mean time, consider implementing and registering a custom serializer 让自己更好地控制 IO 进程的工作方式。