Catch JRRuntimeException to improve reporting error reports

Description

If a jasperreport generates a JRRuntimeException, this should be caught and the rethrown exception include the template name to help locate the offending report.

E.g. if a font cannot be located, the current error looks like:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Arial" is not available to the JVM. See the Javadoc for more details. at net.sf.jasperreports.engine.fonts.FontUtil.checkAwtFont(FontUtil.java:360) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.loadFont(SimpleTextLineWrapper.java:368) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.getGeneralFontInfo(SimpleTextLineWrapper.java:338) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.createFontInfo(SimpleTextLineWrapper.java:278) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.start(SimpleTextLineWrapper.java:240) at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:536) at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:672) at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:186) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:352) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:421) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:396) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:317) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:155) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:164) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:474) at org.openvpms.report.jasper.AbstractJasperIMReport.generate(AbstractJasperIMReport.java:295) at org.openvpms.web.workspace.reporting.report.SQLReportPrinter.getDocument(SQLReportPrinter.java:206) at org.openvpms.web.component.print.InteractivePrinter.getDocument(InteractivePrinter.java:212) at org.openvpms.web.component.print.InteractivePrinter.getDocument(InteractivePrinter.java:199) at org.openvpms.web.component.print.InteractivePrinter.doPrintPreview(InteractivePrinter.java:439) at org.openvpms.web.workspace.reporting.report.InteractiveSQLReportPrinter.access$000(InteractiveSQLReportPrinter.java:43) at org.openvpms.web.workspace.reporting.report.InteractiveSQLReportPrinter$1.doPreview(InteractiveSQLReportPrinter.java:84) at org.openvpms.web.workspace.reporting.report.SQLReportDialog.onPreview(SQLReportDialog.java:94) at org.openvpms.web.component.print.PrintDialog$1.onAction(PrintDialog.java:192) at org.openvpms.web.echo.event.ActionListener.actionPerformed(ActionListener.java:40) at nextapp.echo2.app.button.AbstractButton.fireActionPerformed(AbstractButton.java:135) at echopointng.ButtonEx$1.actionPerformed(ButtonEx.java:120) at nextapp.echo2.app.button.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:70) at echopointng.model.DefaultButtonModelEx.doAction(DefaultButtonModelEx.java:51) at echopointng.ButtonEx.processInput(ButtonEx.java:202) at nextapp.echo2.app.update.ClientUpdateManager.process(ClientUpdateManager.java:116) at nextapp.echo2.app.update.UpdateManager.processClientUpdates(UpdateManager.java:89) at nextapp.echo2.webcontainer.ContainerSynchronizeService.renderUpdate(ContainerSynchronizeService.java:471) at nextapp.echo2.webrender.service.SynchronizeService.service(SynchronizeService.java:279) at nextapp.echo2.webrender.WebRenderServlet.process(WebRenderServlet.java:273) at org.openvpms.web.echo.servlet.SpringWebContainerServlet.process(SpringWebContainerServlet.java:178) at nextapp.echo2.webrender.WebRenderServlet.doPost(WebRenderServlet.java:189) at javax.servlet.http.HttpServlet.service(HttpServlet.java:643) at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openvpms.web.echo.servlet.Log4JMDCUserFilter.doFilter(Log4JMDCUserFilter.java:58) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:745)

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Affects versions

1.8

Priority

Minor