MongoDB 4.0 JRException:除带有说明参数的聚合

时间:2019-07-20 10:29:56

标签: mongodb jaspersoft-studio

我最近将MongoDB数据库版本从3.4更改为4.0,然后开始出现此错误:

即使我添加了光标选项:cursor:{}我也收到错误,但未找到结果

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

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

错误:

  

net.sf.jasperreports.engine.JRException:   net.sf.jasperreports.engine.JRRuntimeException:   net.sf.jasperreports.engine.JRException:“光标”选项为   必需,但带有explain参数的聚合除外       在com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:550)       在com.jaspersoft.studio.editor.preview.view.control.ReportController.access $ 18(ReportController.java:525)       在com.jaspersoft.studio.editor.preview.view.control.ReportController $ 1.run(ReportController.java:443)       在org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)上由以下原因引起:net.sf.jasperreports.engine.JRRuntimeException:   net.sf.jasperreports.engine.JRException:“光标”选项为   必需,但带有explain参数的聚合除外       在net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:150)       在net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152)       在net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:542)       在net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:453)       在net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:428)       在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2585)       在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813)       在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264)       在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)       在net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)       在net.sf.jasperreports.engine.fill.BaseFillHandle $ ReportFill.run(BaseFillHandle.java:135)       在java.lang.Thread.run(Thread.java:748)导致原因:net.sf.jasperreports.engine.JRException:'cursor'选项是   必需,但带有explain参数的聚合除外       在com.jaspersoft.mongodb.query.MongoDbQueryWrapper.runCommand(MongoDbQueryWrapper.java:207)       在com.jaspersoft.mongodb.query.MongoDbQueryWrapper.processQuery(MongoDbQueryWrapper.java:115)       在com.jaspersoft.mongodb.query.MongoDbQueryWrapper。(MongoDbQueryWrapper.java:93)       在com.jaspersoft.mongodb.query.MongoDbQueryExecuter.createDatasource(MongoDbQueryExecuter.java:104)       在net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1257)       在net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:726)       在net.sf.jasperreports.components.list.FillDatasetRun.start(FillDatasetRun.java:166)       在net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:102)       ...还有11个

1 个答案:

答案 0 :(得分:0)

JasperSoft论坛上的这篇文章解决了这个问题:

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

概述的步骤(在JasperSoft Server 7.2.0上)

  1. 下载这两个JAR文件:

Mongo Java Driver

JS MongoDB driver

  1. {jasperserver_root} \ apache-tomcat \ webapps \ jasperserver \ WEB-INF \ lib

  2. 中删除这些文件的较旧版本。
  3. 将第1步中的文件放入 {jasperserver_root} \ apache-tomcat \ webapps \ jasperserver \ WEB-INF \ lib

  4. 重新启动报告服务器

对于JasperSoft Studio,此问题已在7.5.0版中修复。另外,这可能是在JasperSoft Server 7.5.0中修复的,但是,我当前的部署是7.2.0