#1 2021-02-23 18:48:20

telpochyaotl
Member
Registered: 2021-02-17

debugging JasperReports issues.

Hello there!

We're about to deploy a few JasperReports and one thing I'm noticing in some is that they don't render the PDF when i attempt to preview them or pull them as a PDF via url. They simply show the PDF interface but blank.

I know for example that one of them is trying to use images that won't be found. Another one definitely has an SQL error that when corrected the PDF is properly generated.

My issue is that I'm not getting any details in tomcat logs about any issues filling up the reports.  Anticipating I will have similar issues running reports,

How does one debug these issues? What logs to look at, etc? I'd love to see the jasper report logs failing to run the query, not finding the images, etc.

Thank you so much!

Worth noting that compile reports are returned on screen, but issues such as SQL syntax queries do render a PDF but it's blank.

Last edited by telpochyaotl (2021-02-23 23:37:51)

Offline

#2 2021-02-24 09:59:31

eduardo
Administrator
Registered: 2016-11-01
Website

Re: debugging JasperReports issues.

Hi telpochyaotl,

yes, you are right, jasper errors should have a better output, we will look into this at this ticket and update here when we have more information: RS-4724

Regards,
Eduardo

Offline

#3 2021-02-24 15:55:36

telpochyaotl
Member
Registered: 2021-02-17

Re: debugging JasperReports issues.

Thank you Eduardo!

Offline

#4 2021-02-25 13:47:41

eduardo
Administrator
Registered: 2016-11-01
Website

Re: debugging JasperReports issues.

Hi telpochyaotl,

I have a working jasper report that is based on the internal rs datasource, and just outputs the users with this query:
select * from rs_query

it works.

When I change the query to:
select * from _rs_user
which is an invalid query, I get an error in reportserver:

Error: An error occurred during report execution.
The report could not be executed: Could not execute report: Error executing SQL statement for: rs_user.
To get help please contact an administrator.
Details
net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: Could not execute report: Error executing SQL statement for: rs_user. at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:243) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:144) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.executeReport(ReportExportServlet.java:557) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doExportReport(ReportExportServlet.java:438) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReport(ReportExportServlet.java:368) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportViaSession(ReportExportServlet.java:361) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doGet(ReportExportServlet.java:171) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$33940940.CGLIB$doGet$9() at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$33940940$$FastClassByGuice$$1bd476e1.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:76) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:64) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:78) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:78) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:54) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$33940940.doGet() at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$33940940.CGLIB$service$17() at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$33940940$$FastClassByGuice$$1bd476e1.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:76) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:78) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:54) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$33940940.service() at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290) at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:280) at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184) at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:89) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:94) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: Could not execute report: Error executing SQL statement for: rs_user. at net.datenwerke.rs.base.service.reportengines.jasper.JasperReportEngine.executeReport(JasperReportEngine.java:304) at net.datenwerke.rs.base.service.reportengines.jasper.JasperReportEngine.doExecute(JasperReportEngine.java:110) at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:143) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:211) ... 54 more Caused by: net.sf.jasperreports.engine.JRException: Error executing SQL statement for: rs_user. at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:357) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1257) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:726) at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:457) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:578) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:414) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:120) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:103) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:530) at net.datenwerke.rs.base.service.reportengines.jasper.JasperReportEngine.executeReport(JasperReportEngine.java:294) ... 57 more Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name '_rs_user'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:426) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:372) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:284) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:1418) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:312) ... 66 more

so this is working with the latest rs-version (3.4.0).

Can you pls check? and if you get a blank page: can you create a simple test report based on rs_user or some similar query for us to reproduce ?

Regards,
Eduardo

Offline

#5 2021-02-25 19:23:13

telpochyaotl
Member
Registered: 2021-02-17

Re: debugging JasperReports issues.

Hello Eduardo!

I feel a bit dumb now because the issue could boil down to a query that returns no data but runs without errors. Some how I would have expected the query to error the way it was, but because of parameters being Strings an the choice of param string type, the query can run in jasper.

So my report runs but given the query has no results, I get a blank pdf.  I was actually expecting to see an error because the JRXML references images that won't be found but the fact that the query had no errors and the report produced a blank page, this hid the FileNotFound error for the images. Given a query with results, then i see the FileNotFound errors.

This is not really a bug, so I can only apologize for wasting your time with this.

You are correct, if the query really results in an error, the error is displayed.

To try to make something good about my mistake here, I'm going to try to figure out how to make JasperReports print the query it will run in the log.

Sorry again and thank you so much for your time and attention.

Offline

Board footer

Powered by FluxBB