MarkLogic版本:9.0.6 数据中心框架:3.0.0
在MarkLogic服务器上成功初始化data-hub-framework之后,我正尝试部署一个使用dhf.xqy的javascript模块。
const dhf = require('/com.marklogic.hub/dhf.xqy');
当我运行“ gradle mlLoadModules”命令时,构建成功,没有任何错误。但是,当我运行“ gradle mlDeploy”命令时,出现错误“未找到模块/com.marklogic.hub/dhf.xqy”
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$1(DefaultModulesLoader
.java:452)
at
com.marklogic.client.ext.modulesloader.impl.DefaultModulesLoader.
lambda$executeTask$5(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
答案 0 :(得分:1)
好像文档没有赶上前一阵子所做的更改。改用它:
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上提交文档错误以进行更新。