Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser

Hi all

I just upgrade from Jasper5.0.1 to Jasper5.5.1. But when i run report, i got the error:

threw a JobExecutionException:
org.quartz.JobExecutionException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser [See nested exception: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser]
    at com.lucent.vital.vq.reportserver.quartz.QuartzReportJob.execute(
    at org.quartz.simpl.SimpleThreadPool$
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
    at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(
    at net.sf.jasperreports.engine.fill.JRFiller.createFiller(
    at net.sf.jasperreports.engine.fill.BaseFillHandle.<init>(
    at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.<init>(
    at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.<init>(
    at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.createHandle(
    at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.createHandle(

I foundsome solutions on internet: (

"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=trueon system startup."

I tried to set in my app:

System.setProperty("java.awt.headless", "true");

But i still got above error.

My report still run sucessfully with Jasper 5.0.1 without any changes.

Do you have another solution to fix this issue?


Tai Hoang


jmikel's picture
Joined: Oct 21 2013 - 9:38pm
Last seen: 8 years 11 months ago

Ok , la solución que ami me resulto fue actualizar esta libreria common-javaflow.jar, les dejo la liga para la descarga.

anteriormente en mi proyecto estaba trabajando con la libreria common-javaflow20060411.jar

Espero haber ayudado!! (y)


israider - 8 years 2 months ago

5 Answers:

Have you looked into missing fonts? I assume by "Jasper5.5.1" that you mean Jaspersoft Studio?" You're running it on linux?

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago

Hi hozawa.

I don't use Jaspersoft Studio. I override  some classes from JasperReport library to report my report.

Below list jars that i have used:

jasperreports-5.5.1. jar













I run on window server (64-bit Operating System). My report still run normally with Jasper Library 5.0.1.


Tai Hoang


jmikel's picture
Joined: Oct 21 2013 - 9:38pm
Last seen: 8 years 11 months ago

Had the same problem. Apart from few missing dependencies on the way (moved from ant to maven) my problem was fixed by adding            


Apparently JRStyledTextParser is using dependency from xml-apis in the constructor

dtyshecky's picture
Joined: May 14 2014 - 4:51pm
Last seen: 9 years 3 months ago

If you're using SYS V init and running in a container such a Tomcat, DON'T start the script directly with:

sudo /etc/init.d/tomcat7 start

That will start it without a clean environment.

Instead, use the service command:

sudo /sbin/service tomcat7 start
Pixel's picture
Joined: Dec 3 2013 - 8:30am
Last seen: 4 months 1 week ago

Tenia el mismo problema, lo solucione, removiendo la libreria jar xvf jasperreports-5.....jar, y en su lugar le coloque la libreria jasperreports-5.2.0.jar

Y en los reportes solo utilice fonts , sansSerif o Serif




palaciobravo's picture
Joined: Jan 25 2013 - 12:45pm
Last seen: 3 years 4 months ago