mailtoakshay Posted July 20, 2007 Share Posted July 20, 2007 Hi, We are using Jasperreports in our application to run reports. When the report has huge data to print, and two users are parallely trying to run the report at around the same time, one user will get the report(sometimes full report, sometimes partial). Another user will get a blank pdf. The server has the following exception generated displayed - java.lang.NullPointerException at com.lowagie.text.pdf.PdfDocument.newPage(PdfDocument.java:814) at com.lowagie.text.pdf.PdfDocument.close(PdfDocument.java:925) at com.lowagie.text.Document.close(Document.java:520) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:473) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:260) at com.usdataworks.cw.report.ReportService.generateReportToStream(ReportService.java:286) at com.usdataworks.cw.report.ReportService.generateReportResponse(ReportService.java:211) at com.usdataworks.ice.controller.AdminReportsAction.run(AdminReportsAction.java:198) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196) at com.usdataworks.cw.security.UsdwAction.execute(UsdwAction.java:80) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:163) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:675) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:623) at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:384) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:353) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71) at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672) please help me resolve this issue. Thanks, Akshay Link to comment Share on other sites More sharing options...
warrenzhai Posted July 23, 2007 Share Posted July 23, 2007 We are getting the same error message in production. What version of Jasper are you using? We are using version 1.2.5. Link to comment Share on other sites More sharing options...
mailtoakshay Posted July 23, 2007 Author Share Posted July 23, 2007 Hi, Thanks for the reply. We too are using the version 1.2.5 of ireports for jasper. Any idea, if this has got to do with the version? please help me if you are able to find a solution. Link to comment Share on other sites More sharing options...
contentengineer Posted July 24, 2007 Share Posted July 24, 2007 I've seen similar problems, some potential causes: - Null dataset (check database connections and/or use of temporary tables/shared userid) - Using same target PDF file (potentially overwriting, or getting other error) Link to comment Share on other sites More sharing options...
warrenzhai Posted July 25, 2007 Share Posted July 25, 2007 We are using JasperReports 1.2.5 and iText 1.4. Both directly from the Maven repository. The NullPointerException is actually caused by iText rather than Jasper. Does anyone have a firm idea as to when those errors occur, and how to reproduce it? Warren Link to comment Share on other sites More sharing options...
mailtoakshay Posted July 25, 2007 Author Share Posted July 25, 2007 Hi all, Thanks for the replies. Guess I have a work around for the problem. Tried the same and its working. The problem was occuring only when the data to be printed was huge. So, use Synchronization to solve this. Keep the code that calls the jasper as a 'synchronized' block. This should do it. Link to comment Share on other sites More sharing options...
warrenzhai Posted July 26, 2007 Share Posted July 26, 2007 Serializing Jasper report generation may not be desirable depending on your user load. Could someone point me to the source of itext 1.3.1 which came with Jasper 1.2.5? Link to comment Share on other sites More sharing options...
lucianc Posted July 26, 2007 Share Posted July 26, 2007 warrenzhai wrote:Could someone point me to the source of itext 1.3.1 which came with Jasper 1.2.5? You will find it on the iText site (go to downloads/older versions). Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now