如何从巨大的mongodb文档生成报告

时间:2017-05-27 05:58:46

标签: java mongodb jasper-reports

我是碧玉报道的新手。我尝试通过调用Java API使用来自2个缺少文档的mongodb的jasper报告生成报告。如果仅应用查找查询工作正常,但我应用排序。那个时候我遇到了异常。所以我如何解决这个问题任何人都可以帮助我。

com.mongodb.MongoQueryException:查询失败,错误代码为17144,错误消息为'Executor error:OperationFailed:Sort operat     离子使用超过最大33554432字节的RAM。添加索引,或指定较小的限制。'

我构建以下查询,

<queryString language="MongoDbQuery">
        <![CDATA[{
                    "collectionName": "Customer_Detail",
                    "findQuery": $P!{whereClause}, 
                     sort:{'creditRating' : 1} 
                }, allowDiskUse: true]]>
    </queryString>

这是完全例外

2017-05-27 10:10:33,647 INFO  [MongoDbQueryWrapper] - Processing mongoDB query
2017-05-27 10:10:33,666 DEBUG [MongoDbQueryWrapper] - 
Query: {
    "collectionName": "Customer_Detail",
    "findQuery": {},
     sort:{'creditRating' : 1}
    }, allowDiskUse: true
2017-05-27 10:10:33,674 INFO  [MongoDbDataSource] - New MongoDB Data Source
2017-05-27 10:10:42,062 DEBUG [JasparReportEngine] - ~SERVER03~-8068453390450533331~admin~~CustomerReportService~1~~~~~admin~~~~~17
~JasparReport Error
com.mongodb.MongoQueryException: Query failed with error code 17144 and error message 'Executor error: OperationFailed: Sort operat
ion used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.' on server 192.168.1.105:27017
        at com.mongodb.connection.ProtocolHelper.getQueryFailureException(ProtocolHelper.java:91)
        at com.mongodb.connection.QueryProtocol.receiveMessage(QueryProtocol.java:288)
        at com.mongodb.connection.QueryProtocol.execute(QueryProtocol.java:229)
        at com.mongodb.connection.QueryProtocol.execute(QueryProtocol.java:38)
        at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:155)
        at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:219)
        at com.mongodb.connection.DefaultServerConnection.query(DefaultServerConnection.java:166)
        at com.mongodb.operation.FindOperation$1.call(FindOperation.java:397)
        at com.mongodb.operation.FindOperation$1.call(FindOperation.java:394)
        at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:195)
        at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:168)
        at com.mongodb.operation.FindOperation.execute(FindOperation.java:394)
        at com.mongodb.operation.FindOperation.execute(FindOperation.java:57)
        at com.mongodb.Mongo.execute(Mongo.java:736)
        at com.mongodb.Mongo$2.execute(Mongo.java:723)
        at com.mongodb.DBCursor.initializeCursor(DBCursor.java:815)
        at com.mongodb.DBCursor.hasNext(DBCursor.java:149)
        at com.jaspersoft.mongodb.MongoDbDataSource.next(MongoDbDataSource.java:139)
        at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:1405)
        at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1254)
        at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1233)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1577)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:149)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:152)
        at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:464)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:861)
        at mavens.dais.report.engine.JasparReportEngine.executeReport(JasparReportEngine.java:71)
        at mavens.dais.report.engine.DaisReportEngine.executeReport(DaisReportEngine.java:44)
        at mavens.dais.report.service.GenericReportService.executeService(GenericReportService.java:74)
        at mavens.dais.sep.service.delegator.ReportServiceDelegator.executeService(ReportServiceDelegator.java:13)
        at mavens.framework.service.helper.ServiceHelper.executeService(ServiceHelper.java:76)
        at mavens.framework.service.helper.ServiceHelper.executeService(ServiceHelper.java:53)
        at mavens.dais.sep.service.manager.ServiceManager.executeService(ServiceManager.java:131)
        at mavens.dais.sep.channel.manager.ChannelManager.processRequest(ChannelManager.java:74)
        at mavens.dais.sep.channel.gateway.DaisWebServiceGateway.process(DaisWebServiceGateway.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(Abstrac
tResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java
:75)

0 个答案:

没有答案