rousseau Posted May 30, 2012 Share Posted May 30, 2012 Basic mongo/jasper report runs fine on both iReport & server. But when I added a subDataset & chart it fails on the server (but still runs quite happily on ireport).Both the main and subdataset use the mongodb connector. The main uses a simple query e.g. {collectionName : 'mybigtable'}. The subset uses another simple query e.g. {collectionName : 'myothertable'}. Both collections are in the same database, so the chart is set to share the connection using the ususal $P{REPORT_CONNECTION} setting. XML extract below.As above, chart runs fine under iReports 4.5.0, but when deployed to the server get the following error: Error Messagecom.jaspersoft.jasperserver.api.JSExceptionWrapper: No MongoDB connectionError Tracecom.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: No MongoDB connection at com.jaspersoft.mongodb.query.MongoDbQueryExecuter.createDatasource(MongoDbQueryExecuter.java:103) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:731) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:629) at net.sf.jasperreports.engine.fill.JRFillDatasetRun.evaluate(JRFillDatasetRun.java:132) at net.sf.jasperreports.engine.fill.JRFillElementDataset.evaluateDatasetRun(JRFillElementDataset.java:224) at net.sf.jasperreports.engine.fill.JRFillChart.evaluateDatasetRun(JRFillChart.java:1356) at net.sf.jasperreports.engine.fill.JRFillChart.evaluateChart(JRFillChart.java:792) at net.sf.jasperreports.engine.fill.JRFillChart.evaluateRenderer(JRFillChart.java:769) at net.sf.jasperreports.engine.fill.JRFillChart.resolveElement(JRFillChart.java:1334) at net.sf.jasperreports.engine.fill.JRFillElement.performDelayedEvaluation(JRFillElement.java:859) at net.sf.jasperreports.engine.fill.JRFillElement.resolveElement(JRFillElement.java:945) atetc.Server build info:Product Version: 4.5.0Build: 20120110_1602Mongo connector is 0.5.0/SteveCode:<timeSeriesChart> <chart evaluationTime="Report"> <reportElement x="0" y="437" width="802" height="98"/> <chartTitle/> <chartSubtitle/> <chartLegend position="Left"/> </chart> <timeSeriesDataset timePeriod="Milisecond"> <dataset> <datasetRun subDataset="mytable"> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> </datasetRun> </dataset> <timeSeries> <seriesExpression><![CDATA["MySeries"]]></seriesExpression> <timePeriodExpression><![CDATA[new Date($F{timestamp}*1000L)]]></timePeriodExpression> <valueExpression><![CDATA[$F{trigger_event_value}]]></valueExpression> </timeSeries> </timeSeriesDataset> <timeSeriesPlot isShowLines="false"> <plot/> </timeSeriesPlot> </timeSeriesChart> Link to comment Share on other sites More sharing options...
mgeise Posted June 29, 2012 Share Posted June 29, 2012 There has been a bug logged on this issue and can be tracked here: http://jasperforge.org/plugins/mantis/view.php?id=5794The short answer is that it is fixed with v4.7 and will be bundled there, but a workaround exists:You need to pass the PARAMETERS_MAP to the table or subreport. This will cause the MongoDB connection to be passed as desired. This will not be necessary in 4.7, but it will not hurt anything. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now