Jump to content
JasperReports Library 7.0 is now available ×

Run jasper report from servlet


a.merghani
Go to solution Solved by a.merghani,

Recommended Posts

Dears,

I have nested java project which use jasper report to generate some reports. The project structure is like this:

-WebProject (web application)

-JasperProject(java application)

I added the JasperProject to build path. I test the JasperProject and it works perfect.

When I tried to test the same functinality from WebProject it throw this exception:


May 18, 2015 8:33:56 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [sd.nctr.e15.gui.AJAX_Data] in context with path [/E15] threw exception
java.lang.NullPointerException
        at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:517)
        at sd.nctr.e15.generator.JasperReportFill.filler(JasperReportFill.java:89)
        at sd.nctr.e15.generator.access.ReceiptData.generate(ReceiptData.java:152)
        at sd.nctr.e15.gui.IssuingReceipt.generateE15(IssuingReceipt.java:256)
        at sd.nctr.e15.gui.AJAX_Data.doPost(AJAX_Data.java:309)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)

I tried to make the JasperProject withen WebProject as one project but the same exception. My question is: Is there any problem the Jasper report to work from Web Application or from Servlet??

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thanks for your reply. The template kept in the JasperProject. As mentioned before, I have nested projects. I have Web application that call JasperProject

to do the generation. Again, it works within the JasperProject which is stand alone java application.

 

Link to comment
Share on other sites

  • Solution

Dears all,

Thanks to all for your replies After painfull tracing of the peroblem, finally, I solved the prolem. It was casued by conflict in the included library in the WebProject. There was 2 lib for jasper with deff version.

regards

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...