0

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

在 MarkLogic 服务器上成功初始化数据集线器框架后,我正在尝试部署一个使用 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
4

1 回答 1

1

Looks like the documentation hasn't caught up with a change that was made a while ago. Use this instead:

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

You can verify that this is the correct path by looking in /opt/MarkLogic/Modules/MarkLogic/ (Linux). You'll see a /data-hub-framework/ directory there. The path you have is from when dhf.xqy was a module that shipped with and was deployed by DHF, but that code has been included with MarkLogic since ML version 9.0-5.

I'll file a documentation bug on DHF's GitHub to get that updated.

于 2018-07-17T11:01:52.990 回答