Run jasper report from servlet


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(         at net.sf.jasperreports.engine.JasperFillManager.fillReport(         at net.sf.jasperreports.engine.JasperFillManager.fillReport(         at sd.nctr.e15.generator.JasperReportFill.filler(         at sd.nctr.e15.generator.access.ReceiptData.generate(         at sd.nctr.e15.gui.IssuingReceipt.generateE15(         at sd.nctr.e15.gui.AJAX_Data.doPost(         at javax.servlet.http.HttpServlet.service(         at javax.servlet.http.HttpServlet.service(         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(         at org.apache.catalina.core.ApplicationFilterChain.doFilter(         at org.apache.tomcat.websocket.server.WsFilter.doFilter(         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(         at org.apache.catalina.core.ApplicationFilterChain.doFilter(         at org.apache.catalina.core.StandardWrapperValve.invoke(         at org.apache.catalina.core.StandardContextValve.invoke(         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(         at org.apache.catalina.core.StandardHostValve.invoke(         at org.apache.catalina.valves.ErrorReportValve.invoke(         at org.apache.catalina.valves.AccessLogValve.invoke(         at org.apache.catalina.core.StandardEngineValve.invoke(         at org.apache.catalina.connector.CoyoteAdapter.service(         at org.apache.coyote.http11.AbstractHttp11Processor.process(         at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(         at$         at java.util.concurrent.ThreadPoolExecutor.runWorker(         at java.util.concurrent.ThreadPoolExecutor$         at

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

Ahmed Merghani
Ahmed MerghaniSoftware EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ahmed MerghaniSoftware EngineerAuthor Commented:
Dears all,

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.