MongoDB 4.0 JRException: The 'cursor' option is required, except for aggregate with the explain argument

别说谁变了你拦得住时间么 提交于 2020-05-15 21:20:07

问题


I recently changed my MongoDB database version from 3.4 to 4.0 and I started getting this error:

Even though I added the cursor option: cursor :{} I get the error no result Found

{
    runCommand: {
        aggregate : 'Org',
        pipeline : [
            {
                $project : {

                    Miss_Attr.categorie:1,
                    Miss_Attr.texte:1
                }
            },
            { $unwind : '$Miss_Attr'}
       ]
}}

Error:

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: The 'cursor' option is required, except for aggregate with the explain argument at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:550) at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:525) at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:443) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: The 'cursor' option is required, except for aggregate with the explain argument at net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:150) at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:542) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:453) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:428) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2585) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135) at java.lang.Thread.run(Thread.java:748) Caused by: net.sf.jasperreports.engine.JRException: The 'cursor' option is required, except for aggregate with the explain argument at com.jaspersoft.mongodb.query.MongoDbQueryWrapper.runCommand(MongoDbQueryWrapper.java:207) at com.jaspersoft.mongodb.query.MongoDbQueryWrapper.processQuery(MongoDbQueryWrapper.java:115) at com.jaspersoft.mongodb.query.MongoDbQueryWrapper.(MongoDbQueryWrapper.java:93) at com.jaspersoft.mongodb.query.MongoDbQueryExecuter.createDatasource(MongoDbQueryExecuter.java:104) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1257) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:726) at net.sf.jasperreports.components.list.FillDatasetRun.start(FillDatasetRun.java:166) at net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:102) ... 11 more


回答1:


This article on JasperSoft forums fixes this:

https://community.jaspersoft.com/jasperreports-server/issues/10886

Outlined steps (on JasperSoft Server 7.2.0)

  1. Download these two JAR files:

Mongo Java Driver

JS MongoDB driver

  1. Remove the older variants of these files from {jasperserver_root}\apache-tomcat\webapps\jasperserver\WEB-INF\lib

  2. Place files from step 1 into {jasperserver_root}\apache-tomcat\webapps\jasperserver\WEB-INF\lib

  3. Reboot reporting server

For JasperSoft Studio, this is fixed in version 7.5.0. Also, it might be that this is fixed in JasperSoft Server 7.5.0, however, my current deployment is 7.2.0



来源:https://stackoverflow.com/questions/57123855/mongodb-4-0-jrexception-the-cursor-option-is-required-except-for-aggregate-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!