This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Servlets and the fly likes java.lang.NoClassDefFoundError: while running jasper report from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

java.lang.NoClassDefFoundError: while running jasper report from servlet

Balaji Kadam
Ranch Hand

Joined: Apr 27, 2010
Posts: 31

Hello,

I am getting folowing error while loading jasper from servlet in production.
jasperreports3.5.1.ar is in web-inf/lib folder
Greatly apprciate immediate response. Thanks!

Servlet.service() for servlet bodReportServlet threw exception
java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:177)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:78)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:60)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:83)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:628)
at servlets.BodReportServlet.service(BodReportServlet.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
Rudy Gireyev
Ranch Hand

Joined: May 03, 2011
Posts: 39
Balaji Khandekar wrote:Hello,

I am getting folowing error while loading jasper from servlet in production.
jasperreports3.5.1.ar is in web-inf/lib folder
Greatly apprciate immediate response. Thanks!

Servlet.service() for servlet bodReportServlet threw exception
java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
What I do in situations like these is, I open up the JAR (jasperreports3.5.1.jar in your case) and I try to find the class in it (JRStyledTextParser) your path should be net.sf.jasperreports.engine.util. as the exception has told you.

Sometimes it turns out to be the wrong JAR, or wrong release JAR, or sometimes it's just plain missing even though I thought it was there.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63227
    
  69

Please do not post the same question more than once.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: java.lang.NoClassDefFoundError: while running jasper report from servlet
 
It's not a secret anymore!