Marklogic - 模块 /com.marklogic.hub/dhf.xqy 未找到

Marklogic - Module /com.marklogic.hub/dhf.xqy not found

MarkLogic 版本:9.0.6 数据中心框架工作:3.0.0

在 MarkLogic 服务器上成功初始化 data-hub-framework 后,我正在尝试部署一个 javascript 模块,该模块使用了 dhf.xqy.

const dhf = require('/com.marklogic.hub/dhf.xqy');

当我运行 'gradle mlLoadModules' 命令时,构建成功,没有任何错误。但是当我 运行 'gradle mlDeploy' 命令时,出现错误 ' Module /com.marklogic.hub/dhf.xqy not found'

PS G:\data-hub> gradle mldeploy

> Task :hubPreInstallCheck
com.marklogic.hub.impl.DataHubImpl@113a53ae
Error caught while loading modules, cause: Local message: config/resources 
write failed: Bad Request. Server Message: RE
STAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: invalid customer- 
pref extension: could not parse JavaScript extens
ion customer-pref; please see the server error log for detail XDMP- 
MODNOTFOUND: (function (exports, module, require) { c
onst dhf = require('/com.marklogic.hub/dhf.xqy'); -- Module 
/com.marklogic.hub/dhf.xqy not found; customer-pref either i
s not a valid JavaScript module or does not export functions (delete, get, 
put, post)
com.marklogic.client.FailedRequestException: Local message: 
config/resources write failed: Bad Request. Server Message:
RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: invalid customer- 
pref extension: could not parse JavaScript exte
nsion customer-pref; please see the server error log for detail XDMP- 
MODNOTFOUND: (function (exports, module, require) {
const dhf = require('/com.marklogic.hub/dhf.xqy'); -- Module 
/com.marklogic.hub/dhf.xqy not found; customer-pref either
is not a valid JavaScript module or does not export functions (delete, 
get, put, post)
    at
com.marklogic.client.impl.OkHttpServices.putPostValueImpl
(OkHttpServices.java:2872)
    at 
com.marklogic.client.impl.OkHttpServices.putValue
(OkHttpServices.java:2739)
    at 
com.marklogic.client.impl.ResourceExtensionsImpl.writeServices
(ResourceExtensionsImpl.java:206)
    at 
 com.marklogic.client.ext.modulesloader.impl.DefaultModulesLoader.
lambda$installService(DefaultModulesLoader
.java:452)
    at 
 com.marklogic.client.ext.modulesloader.impl.DefaultModulesLoader.
lambda$executeTask(DefaultModulesLoader.java:545)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

BUILD SUCCESSFUL in 52s
4 actionable tasks: 4 executed

文档似乎没有跟上前一段时间所做的更改。改用这个:

const dhf = require('/MarkLogic/data-hub-framework/dhf.xqy');

您可以通过查看 /opt/MarkLogic/Modules/MarkLogic/ (Linux) 来验证这是正确的路径。你会在那里看到一个 /data-hub-framework/ 目录。您拥有的路径是从 dhf.xqy 是 DHF 随附并由 DHF 部署的模块开始的,但自 ML 9.0-5 版以来,该代码已包含在 MarkLogic 中。

我将在 DHF's GitHub 上提交文档错误以更新。