【问题标题】:Page Not Found error while searching Marklogic transforms搜索 Marklogic 转换时出现页面未找到错误
【发布时间】:2015-02-27 08:17:42
【问题描述】:

我正在尝试使用 link 中的示例在 Marklogic 中实现转换

当我尝试使用以下 curl 命令安装转换时

curl --anyauth --user admin:admin -X PUT -d@"./add-attr.xqy" -H "Content-type: application/xquery" 'http://localhost:8000/LATEST/config/transforms/add-attr?trans:name=string\?&trans:value=string\?'

它给了我像(使用 curl)这样的错误

<div><h3>Message</h3><div style="width: 100%; height: 300px; overflow: auto;"><pre>&lt;error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;error:code&gt;XDMP-BADREP&lt;/error:code&gt;
&lt;error:name&gt;err:FORX0004&lt;/error:name&gt;
&lt;error:xquery-version&gt;1.0-ml&lt;/error:xquery-version&gt;
&lt;error:message&gt;Invalid replacement string&lt;/error:message&gt;
&lt;error:format-string&gt;XDMP-BADREP: (err:FORX0004) fn:replace("/LATEST/config/transforms/add-attr", attribute{fn:QName("", "uri")}{"^/(common-api|dashboard|history|manage|nav|packaging|rest-apis)(..."}, &amp;lt;rest:uri-param name="url" xmlns:rest="http://marklogic.com/appservices/rest"&amp;gt;/LATEST/config/transforms/add-attr?trans:name=string\?&amp;amp;amp;trans...&amp;lt;/rest:uri-param&amp;gt;) -- Invalid replacement string: /LATEST/config/transforms/add-attr?trans:name=string\?&amp;amp;trans:value=string\?&lt;/error:format-string&gt;
&lt;error:retryable&gt;false&lt;/error:retryable&gt;
&lt;error:expr&gt;fn:replace("/LATEST/config/transforms/add-attr", attribute{fn:QName("", "uri")}{"^/(common-api|dashboard|history|manage|nav|packaging|rest-apis)(..."}, &amp;lt;rest:uri-param name="url" xmlns:rest="http://marklogic.com/appservices/rest"&amp;gt;/LATEST/config/transforms/add-attr?trans:name=string\?&amp;amp;amp;trans...&amp;lt;/rest:uri-param&amp;gt;)&lt;/error:expr&gt;
&lt;error:data&gt;
&lt;error:datum&gt;/LATEST/config/transforms/add-attr?trans:name=string\?&amp;amp;trans:value=string\?&lt;/error:datum&gt;

我什至尝试使用 Postman-chrome 应用程序,但它给了我 401 Unauthorized 错误。

即使我正在使用

检查可用的转换
http://localhost:8000/v1/config/transforms

它给了我找不到页面 exception

我正在尝试使用具有所有管理员权限的 admin 用户

我在这里缺少什么?如何为 REST 调用构建转换?

【问题讨论】:

    标签: rest marklogic


    【解决方案1】:

    我遇到了同样的错误,但前提是我对 MarkLogic 7 运行上述命令。MarkLogic 7 没有在端口 8000 上运行 REST-api,这是 MarkLogic 8 中的新功能。

    在此旁边,您应该使用 url 编码而不是正则表达式转义 trans:xxx 请求参数值中的问号,例如:

    curl --anyauth --user admin:admin -X PUT -d@"./add-attr.xqy" -H "Content-type: application/xquery" 'http://localhost:8000/LATEST/config/transforms/add-attr?trans:name=string%3F&trans:value=string%3F'
    

    HTH!

    【讨论】:

    猜你喜欢
    • 2013-07-30
    • 1970-01-01
    • 2020-12-18
    • 1970-01-01
    • 1970-01-01
    • 2020-10-28
    • 2015-06-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多