1

我正在使用 nifi 和 marklogic 处理器。我正在尝试将查询处理器与 cts:uri 一起使用……以下是我的 cts:uri 查询

cts:and-query((cts:element-attribute-value-query(fn:QName('http://clarivate.com/schema/wok5.27/public/FullRecord', 'pub_info'),fn:QName('http://clarivate.com/schema/wok5.27/public/FullRecord', 'pubyear'),'2018'), cts:collection-query('dps')))

在此处输入图像描述 上面的查询适用于查询控制台...但是在 nifi 中使用时出现以下异常

018-05-18 14:35:30,270 ERROR [pool-27-thread-3] c.m.nifi.processor.QueryMarkLogic QueryMarkLogic[id=01631005-7b1f-199f-65aa-dfa227609659] QueryMarkLogic[id=01631005-7b1f-199f-65aa-dfa227609659] failed to process due to com.marklogic.client.FailedRequestException: Local message: failed to read resource at documents: Bad Request. Server Message: XDMP-RWINVAL0: The value of expression '$0'  is required to be non-zero in rule: set-transaction-timestamp; rolling back session: com.marklogic.client.FailedRequestException: Local message: failed to read resource at documents: Bad Request. Server Message: XDMP-RWINVAL0: The value of expression '$0'  is required to be non-zero in rule: set-transaction-timestamp
com.marklogic.client.FailedRequestException: Local message: failed to read resource at documents: Bad Request. Server Message: XDMP-RWINVAL0: The value of expression '$0'  is required to be non-zero in rule: set-transaction-timestamp
    at com.marklogic.client.impl.OkHttpServices.checkStatus(OkHttpServices.java:4317)
    at com.marklogic.client.impl.OkHttpServices.getIteratedResourceImpl(OkHttpServices.java:3081)
    at com.marklogic.client.impl.OkHttpServices.getBulkDocumentsImpl(OkHttpServices.java:975)
    at com.marklogic.client.impl.OkHttpServices.getBulkDocuments(OkHttpServices.java:860)
    at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:461)
    at com.marklogic.client.impl.GenericDocumentImpl.read(GenericDocumentImpl.java:23)
    at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:439)
    at com.marklogic.client.impl.GenericDocumentImpl.read(GenericDocumentImpl.java:23)
    at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:408)
    at com.marklogic.client.impl.GenericDocumentImpl.read(GenericDocumentImpl.java:23)
    at com.marklogic.nifi.processor.QueryMarkLogic.getDocs(QueryMarkLogic.java:169)
    at com.marklogic.nifi.processor.QueryMarkLogic.lambda$onTrigger$1(QueryMarkLogic.java:143)
    at com.marklogic.client.datamovement.impl.QueryBatcherImpl$1$1.run(QueryBatcherImpl.java:716)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
2018-05-18 14:35:30,270 ERROR [pool-27-thread-3] c.m.c.datamovement.impl.QueryBatcherImpl Exception thrown by an onUrisReady listener
org.apache.nifi.processor.exception.ProcessException: com.marklogic.client.FailedRequestException: Local message: failed to read resource at documents: Bad Request. Server Message: XDMP-RWINVAL0: The value of expression '$0'  is required to be non-zero in rule: set-transaction-timestamp
    at com.marklogic.nifi.processor.QueryMarkLogic.lambda$onTrigger$1(QueryMarkLogic.java:158)
    at com.marklogic.client.datamovement.impl.QueryBatcherImpl$1$1.run(QueryBatcherImpl.java:716)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.marklogic.client.FailedRequestException: Local message: failed to read resource at documents: Bad Request. Server Message: XDMP-RWINVAL0: The value of expression '$0'  is required to be non-zero in rule: set-transaction-timestamp
    at com.marklogic.client.impl.OkHttpServices.checkStatus(OkHttpServices.java:4317)
    at com.marklogic.client.impl.OkHttpServices.getIteratedResourceImpl(OkHttpServices.java:3081)
    at com.marklogic.client.impl.OkHttpServices.getBulkDocumentsImpl(OkHttpServices.java:975)
    at com.marklogic.client.impl.OkHttpServices.getBulkDocuments(OkHttpServices.java:860)
    at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:461)
    at com.marklogic.client.impl.GenericDocumentImpl.read(GenericDocumentImpl.java:23)
    at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:439)
    at com.marklogic.client.impl.GenericDocumentImpl.read(GenericDocumentImpl.java:23)
    at com.marklogic.client.impl.DocumentManagerImpl.read(DocumentManagerImpl.java:408)
    at com.marklogic.client.impl.GenericDocumentImpl.read(GenericDocumentImpl.java:23)
    at com.marklogic.nifi.processor.QueryMarkLogic.getDocs(QueryMarkLogic.java:169)
    at com.marklogic.nifi.processor.QueryMarkLogic.lambda$onTrigger$1(QueryMarkLogic.java:143)
    ... 4 common frames omitted
2018-05-18 14:35:30,271 INFO [Timer-Driven Process Thread-2] c.m.c.datamovement.impl.QueryBatcherImpl Job complete, jobBatchNumber=0, jobResultsSoFar=0
2018-05-18 14:35:30,272 INFO [Timer-Driven Process Thread-2] c.m.c.e.d.job.SimpleQueryBatcherJob Completed: Generic query batcher job

我在这里做错了什么?

4

1 回答 1

1

尝试将“一致快照”设置为 false。如果这可行,那是由于我们在设置为 true 时试图解决的一些问题。

于 2018-05-19T16:03:54.673 回答