[#14421] - Main/Subreports without Connection throws exception

Category:
Bug report
Priority:
Urgent
Status:
New
Project: Severity:
Block
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

When I execute a report in Jasperserver which has NO datasource and a subreport (main and subreport without query/datasource, title bands only and setting "Show all sections, no detail" Jasperserver throws a Null PointerException:

...
2022-09-22T08:37:30,924 ERROR JRFillSubreport,pool-7-thread-3:961 - Fill 1: exception java.lang.NullPointerException
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.getTimezoneAdjustFromParent(JRTimezoneJdbcQueryExecuter.java:125)
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.<init>(JRTimezoneJdbcQueryExecuter.java:97)
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuterFactory.createQueryExecuter(JRTimezoneJdbcQueryExecuterFactory.java:55)
at net.sf.jasperreports.engine.query.QueryExecuterFactory.createQueryExecuter(QueryExecuterFactory.java:109)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1260)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:732)
at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:457)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:585)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:834)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:61)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

2022-09-22T08:37:30,925 ERROR AsyncJasperPrintAccessor,pool-7-thread-3:321 - Error during report execution java.lang.NullPointerException
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.getTimezoneAdjustFromParent(JRTimezoneJdbcQueryExecuter.java:125)
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.<init>(JRTimezoneJdbcQueryExecuter.java:97)
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuterFactory.createQueryExecuter(JRTimezoneJdbcQueryExecuterFactory.java:55)
at net.sf.jasperreports.engine.query.QueryExecuterFactory.createQueryExecuter(QueryExecuterFactory.java:109)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1260)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:732)
at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:457)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:585)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:834)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:61)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
...

This leads to serious problems, if your Jasperserver report units have no SQL-Connections attached, and the connection is setup diectly in the main report for passing this/these connections to the subreports.

I attach a simple Main/Subreport example.

Thanks in advance,

Thomas Zimmer
https://thomaszimmer.net/
https://jasper-schulungen.de/

AttachmentSize
Binary Data master.jrxml1.75 KB
Binary Data slave.jrxml1.06 KB
v8
Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 1 week 6 days ago

1 Comment:

#1

Meanwhile It noticed, that the error appears even if no subreport is attached.
Greetings,
Thomas Zimmer
https://thomaszimmer.net/
https://jasper-schulungen.de/

Feedback
randomness