[#5794] - "No MongoDB connection" when trying to use mongodb connection with subreports/subdatasets on Jasper Server

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Major
Resolution:
Reopened
Component: Reproducibility:
Always
Assigned to:

Create a report with a subdataset that connects to mongo. It runs fine in iReports 4.5.1, but gives an error in JasperServer 4.5.0:

Error Message

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: No MongoDB connection
Error Trace

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: No MongoDB connection at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:750) at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:159) at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:307) at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:129) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:328) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:393) at
etc

rousseau's picture
Joined: May 20 2012 - 8:46pm
Last seen: 10 years 4 months ago

8 Comments:

#1

Hi,
I am very new to this forum, so please spare me if I am going out-of-box, but, this issue of sub-reports with MongoDB connection is really a critical blocker to us in building one of our products.
I too experienced the same issue.I created a report with multiple sub-reports in iReport.It worked fine in iReport but when deployed on Jasper server, it threw exception of "No MongoDB Connection".
Are we expecting any fix on this in near future? OR is there a workaround already present?
Will really appreciate any quick response.

Thanks
Sujeet

#2

The MongoDB Connector is not standard in JasperReports Server 4.5 (It will be in 4.7).

Did you install the MongoDB Connector into the server as outlined here? http://jasperforge.org/plugins/mwiki/index.php/Bigdatareportingfornosqla...

Is the error you are seeing specific to subdatasets/subreports? Does it work ok with the main query?

#3

Looking into this more, it appears that this will be resolved with our 4.7 release which will include certification with the MongoDB Connector v2.0

#4

Thanks for the quick response!!

Yes, I did install MongoDB Connector into the server.
FYI...
When I deploy only the sub-report in server it works fine.
The issue comes up when I deploy a report with sub-reports in it.

Was just curious to know when are you planning to release 4.7?
It will have a bearing on our project. We are very much inclined to use Jasper server as reporting tool in our project.

Pls. let me know if you want anymore details from me.

Thanks.

#5

>>Did you install the MongoDB Connector into the server as outlined here? http://jasperforge.org/plugins/mwiki/index.php/Bigdatareportingfornosqla... [^]

Yes.

>>Is the error you are seeing specific to subdatasets/subreports? Does it work ok with the main query?

Correct. Reports with only a main query in work fine. The exception is only thrown when adding subreports/subqueries to the main report.

#6

Ok, here is the deal on this...

The issue is fixed in version 1.0 of the connector which will be included/bundled into the 4.7 release. The commercial release will likely be in the next few weeks and the community release will occur about 6-8 weeks after that.

BUT, THERE IS A WORK AROUND!

You need to pass the PARAMETERS_MAP to the table or to the subreport. This should cause the MongoDB connection to be passed along as desired. (That will no longer be needed it 4.7, but it won't hurt anything.)

#7

Thanks a lot mgeise!!
We are looking forward for the 4.7 release.

Meanwhile I tried the work around and it worked!!!

Basically what I did was:
Created a parameter in main report with MongoDBconnection type.
Used the above parameter in sub-report and Dataset Connection expression
This complete report then was deployed on server and it worked great!

#8
  • Resolution:Fixed» Reopened
  • Status:Resolved» Feedback Requested

Hi everyone,

has this problem actually ever been resolved -- I mean, aside from using a workaround?
I'm using jasper server 6.0.3 and still get this error when trying to use a sub report. In JasperStudio, I get the reports to work using the workaround described in comment #6 above. However, when deploying the report/subreport on the server, I still get the error "No MongoDB Connection".
Does anyone have a suggestion how to proceed? Do I really have to define a MongoDBConnection-parameter as described in comment #7 -- forcing me to change every report using this "solution" whenever I need to change the connection (e.g. test vs production environment)?

Thanks!

Here's the stack-trace:

Fehlermeldung

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: No MongoDB connection
Ablaufverfolgung für Fehler

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: No MongoDB connection at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:848) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:383) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:358) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2026) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:754) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:124) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:540) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:120) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:882) at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:165) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:838) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1727) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1082) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1011) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:904) 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:745) Caused by: net.sf.jasperreports.engine.JRException: No MongoDB connection at com.jaspersoft.mongodb.query.MongoDbQueryExecuter.createDatasource(MongoDbQueryExecuter.java:101) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1119) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:691) at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:434) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:508) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:712) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203) ... 3 more

Feedback
randomness