在MarkLogic中读取文档内容时发生异常
当我尝试使用其URI从MarkLogic数据库读取文本文档时..我得到以下指定异常:在MarkLogic中读取文档内容时发生异常,marklogic,Marklogic,当我尝试使用其URI从MarkLogic数据库读取文本文档时..我得到以下指定异常: [Fatal Error] :1:1: Content is not allowed in prolog. Exception in thread "main" com.marklogic.client.FailedRequestException: Local message: read failed: Bad Request. Server Message: Request failed. Unable t
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" com.marklogic.client.FailedRequestException: Local message: read failed: Bad Request. Server Message: Request failed. Unable to parse server error details
at com.marklogic.client.impl.JerseyServices.getDocumentImpl(JerseyServices.java:527)
at com.marklogic.client.impl.JerseyServices.getDocument(JerseyServices.java:393)
at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:210)
at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:144)
at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:114)
at com.marklogic.client.example.tutorial.Example_07_ReadText.main(Example_07_ReadText.java:49)
用户3569076:
听起来请求失败了,但Java API无法解析错误消息,因为错误消息不是XML
创建数据库客户端时,是否为REST API服务器指定主机名和端口
如果没有,以下是为数据库创建REST API服务器的说明:
您可以通过尝试从web浏览器的主机和端口获取文档来测试REST API的可用性:
希望有帮助
Erik Hennum在MarkLogic数据库中加载JSON文件时遇到了相同的错误。 我发现错误是我的JSON文件无效。我的JSON文件中有一些语法错误。 我建议您检查XML文件是否有效
希望这会有所帮助。文档中有什么内容?是的,正确指定了MarkLogic server的主机名和端口号,并且在指定一个目录时,我能够获取大多数文档的URI。但在将该目录更改为其他目录后,我遇到了超过指定错误的情况。但现在不幸的是,我没有得到同样的错误,所以不能分享确切的场景。谢谢