Jump to content

Error trying to run a report parallely by 2 users


mailtoakshay

Recommended Posts

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

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...