jmikel Posted March 29, 2014 Share Posted March 29, 2014 Hi allI 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-noclassdeffounderror-exception-on-net-sf-jasperreports-engine-util)"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 Link to comment Share on other sites More sharing options...
hozawa Posted March 29, 2014 Share Posted March 29, 2014 Have you looked into missing fonts? I assume by "Jasper5.5.1" that you mean Jaspersoft Studio?" You're running it on linux? Link to comment Share on other sites More sharing options...
jmikel Posted March 31, 2014 Author Share Posted March 31, 2014 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. jarcommons-beanutils-1.8.0.jarcommons-collections-2.1.1.jarcommons-digester-2.1.jarcommons-javaflow-20060411.jarcommons-logging-1.1.1.jariText-2.1.7.jarjasperreports-javaflow-5.5.1.jarjcommon-1.0.15.jarjdt-compiler-3.1.1.jarjfreechart-1.0.12.jarpoi-3.7-20101029.jarjasperreports-fonts-5.5.1.jarI run on window server (64-bit Operating System). My report still run normally with Jasper Library 5.0.1.Thanks,Tai Hoang Link to comment Share on other sites More sharing options...
dtyshecky Posted May 14, 2014 Share Posted May 14, 2014 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>[/code] Apparently JRStyledTextParser is using dependency from xml-apis in the constructor Link to comment Share on other sites More sharing options...
israider Posted July 5, 2015 Share Posted July 5, 2015 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.htmanteriormente en mi proyecto estaba trabajando con la libreria common-javaflow20060411.jarEspero haber ayudado!! (y) Link to comment Share on other sites More sharing options...
Pixel Posted August 17, 2016 Share Posted August 17, 2016 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 startThat will start it without a clean environment.Instead, use the service command:sudo /sbin/service tomcat7 start Link to comment Share on other sites More sharing options...
palaciobravo Posted May 18, 2020 Share Posted May 18, 2020 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.jarY en los reportes solo utilice fonts , sansSerif o Serif Link to comment Share on other sites More sharing options...
wawanssnt Posted Wednesday at 07:04 AM Share Posted Wednesday at 07:04 AM Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now