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(QuartzReportJob.java:156)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:123)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
at net.sf.jasperreports.engine.fill.BaseFillHandle.<init>(BaseFillHandle.java:75)
at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.<init>(AsynchronousFillHandle.java:98)
at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.<init>(AsynchronousFillHandle.java:68)
at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.createHandle(AsynchronousFillHandle.java:149)
at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.createHandle(AsynchronousFillHandle.java:202)
I foundsome solutions on internet: (http://stackoverflow.com/questions/3628302/jasperreports-noclassdeffound...)
"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?
Thanks,
Tai Hoang
5 Answers:
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
commons-beanutils-1.8.0.jar
commons-collections-2.1.1.jar
commons-digester-2.1.jar
commons-javaflow-20060411.jar
commons-logging-1.1.1.jar
iText-2.1.7.jar
jasperreports-javaflow-5.5.1.jar
jcommon-1.0.15.jar
jdt-compiler-3.1.1.jar
jfreechart-1.0.12.jar
poi-3.7-20101029.jar
jasperreports-fonts-5.5.1.jar
I run on window server (64-bit Operating System). My report still run normally with Jasper Library 5.0.1.
Thanks,
Tai Hoang
Had the same problem. Apart from few missing dependencies on the way (moved from ant to maven) my problem was fixed by adding
<dependency> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> <version>1.4.01</version> </dependency>
Apparently JRStyledTextParser is using dependency from xml-apis in the constructor
Ok , la solución que ami me resulto fue actualizar esta libreria common-javaflow.jar, les dejo la liga para la descarga. http://www.java2s.com/Code/Jar/c/Downloadcommonsjavaflowjar.htm
anteriormente en mi proyecto estaba trabajando con la libreria common-javaflow20060411.jar
Espero haber ayudado!! (y)