Four Stars

tJasperReportExec when no data get NullPointerException

Hi,

I am working with tJasperReportExec downloaded from exchange site to do some reporting.

My job works just fine when there is some data in the datasource (postgres DB), but when the there is no data (the query return no rows) I get this exception below (even if when I execute the report .jrxml from the TIBCO jaspersoft studio I don't get any error and the report is generated and the subreport in question is just empty)

 

Any Idea why ?

 

The job was compiled in version 6.2.1 (as required in tJasperReportExec) 

 

16:46:33,587|DEBUG|Fill 3: no data
16:46:33,588|DEBUG|Fill 3: closing query executer
16:46:33,588|DEBUG|Fill 3: notifying of completion
16:46:33,588|DEBUG|Fill 3: notified of fill result
16:46:33,589|ERROR|Fill 1: exception
java.lang.NullPointerException
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:135)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:742)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:58)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:216)
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)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Seventeen Stars

Re: tJasperReportExec when no data get NullPointerException

I have checked the source code and it looks like it is an inconsistency within the report definition.

The exception is caused by a missing setting for what should happen if there are no data.

I actually would expect the JasperLibrary should deal with such situations but the obviously does not expect such situations.

So far, it is not a problem of the component. Nevertheless I will update the version of the JasperLibrary used in my component - perhaps TIBCO has solved this issue.

 

I recommend, open the report in the studio and check the settings for No Data in the properties of the report. 

9 REPLIES
Ten Stars

Re: tJasperReportExec when no data get NullPointerException

The Author of component is answer there, so sure he will consult You

 

but by the way - Jan have much better set of components tJasperServerXXXX

yes,You need server for them, but it work like a charm!!!

-----------
Four Stars

Re: tJasperReportExec when no data get NullPointerException

Do you mean  the Author of component has already answerd this issue ?!

 

In my case, I don,t have a jasper server yet (for the moment)

 

Actually, I am using reporting  only from talend to launch the execution of the reporting file .jrxml (developed in jaspersoft studio)

Seventeen Stars

Re: tJasperReportExec when no data get NullPointerException

Hi, the stack trace ist not complete. Could you send me the whole stack trace?

I am always interested in getting information about possible bugs.

It would also be great to see your component settings from your job.

You can contact me also directly: jan.lolling@gmail.com if we need to exchange some files. 

Four Stars

Re: tJasperReportExec when no data get NullPointerException

Hi,

 

Here is the detail of my job (quite simple)

 

1.PNG2.PNG3.PNG

 

Here is the complete log trace 

[statistics] connecting to socket on port 3967
[statistics] connected
Exception in component tJasperReportExec_1
java.lang.NullPointerException
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:135)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:742)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:58)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:216)
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)
[ERROR]: net.sf.jasperreports.engine.fill.JRFillSubreport - Fill 1: exception
java.lang.NullPointerException
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:135)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:742)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:58)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:216)
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)
[statistics] disconnected
Job test1 terminé à 11:24 08/06/2017. [Code sortie=1]

 

 

 

Seventeen Stars

Re: tJasperReportExec when no data get NullPointerException

It looks like you use an out-dated version of the component. Could you please download a current version from Talend Exchange?

Four Stars

Re: tJasperReportExec when no data get NullPointerException

 

I am working with the version 2.3 of the component.

 

Isn't  the last version ?

 

I just downloaded v 2.3 again from exchange site and did the test  again, same exception.

 

 

 
Four Stars

Re: tJasperReportExec when no data get NullPointerException

Hi,

 

So is it a bug or  I am still not using the component last version ?

 

Thanks for your reply 

Seventeen Stars

Re: tJasperReportExec when no data get NullPointerException

I have checked the source code and it looks like it is an inconsistency within the report definition.

The exception is caused by a missing setting for what should happen if there are no data.

I actually would expect the JasperLibrary should deal with such situations but the obviously does not expect such situations.

So far, it is not a problem of the component. Nevertheless I will update the version of the JasperLibrary used in my component - perhaps TIBCO has solved this issue.

 

I recommend, open the report in the studio and check the settings for No Data in the properties of the report. 

Four Stars

Re: tJasperReportExec when no data get NullPointerException

Hi 

 

I modified the report,  For No Data in the properties of the report I put empty instead of null.

 

It worked. 

 

Thanks Jan.