Apache Nifi Marklogic查询处理器

时间:2018-05-18 19:50:20

标签: marklogic apache-nifi marklogic-9

我正在使用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')))

enter image description here 以上查询适用于查询控制台...但在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

我在这里做错了什么?

1 个答案:

答案 0 :(得分:1)

尝试将“Consistent snapshot”设置为false。如果可行,那是因为我们在设置为true时要解决的一些问题。