NoClassDefFoundError for JRStyledTextParser



I recently installed JasperReports 3.7.2 on WebLogic 11g. When trying to generate a report I'm getting:


java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/util/JRStyledTextParser at net.sf.jasperreports.engine.fill.JRBaseFiller.( at net.sf.jasperreports.engine.fill.JRVerticalFiller.( at net.sf.jasperreports.engine.fill.JRVerticalFiller.( at net.sf.jasperreports.engine.fill.JRVerticalFiller.( at net.sf.jasperreports.engine.fill.JRFiller.createFiller( at net.sf.jasperreports.engine.fill.JRFiller.fillReport( at net.sf.jasperreports.engine.JasperFillManager.fillReport( at org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView.fillReport( at org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView.renderMergedOutputModel( at org.springframework.web.servlet.view.AbstractView.render( at org.springframework.web.servlet.DispatcherServlet.render( at org.springframework.web.servlet.DispatcherServlet.doDispatch( at org.springframework.web.servlet.DispatcherServlet.doService( at org.springframework.web.servlet.FrameworkServlet.processRequest( at org.springframework.web.servlet.FrameworkServlet.doPost(


May you give me a hint or tell me what is the error?


Thanks in advance.


Post Edited by pensashure at 09/02/2010 15:39
pensashure's picture
Joined: Sep 2 2010 - 8:03am
Last seen: 12 years 6 months ago

1 Answer:

Finally, I've got it working. I detected the root Exception, which was thrown before NoClassDefFoundError:net/sf/jasperreports/engine/util/JRStyledTextParser :

java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment

The Sun AWT classes on Unix and Linux have a dependence on the X Window System. When you use these classes, they expect to load X client libraries and be able to talk to an X display server. This makes sense if your client has a GUI; unfortunately, it's required even if your client uses AWT but does not have a GUI (which is my case, generating a report from a web application)

The way to bypass this, is setting a system property java.awt.headless=true on system startup.

pensashure's picture
Joined: Sep 2 2010 - 8:03am
Last seen: 12 years 6 months ago