JasperReports:java.lang.NoClassDefFoundError:无法初始化类 net.sf.jasperreports.engine.util.JRStyledTextParser

我想与 JasperReports 分享一个或多或少常见错误的经验.

I would like to share my experience with a more or less common error with JasperReports.

在执行 JasperReports 制作 PDF 报告时,出现异常:

When executing JasperReports to make a PDF report, I have an exception :

java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:108)
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:200)
net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:215)
net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:115)
net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:983)

我的环境:

  • CentOs 6.6 - 内核 2.6.32-504.el6.x86_64
  • Java 1.7_79(星期日)
  • JasperReport 6.2.2
  • Apache Tomcat 7.0.68

同样的问题:

  • java.lang.NoClassDefFoundError: 无法初始化类 net.sf.jasperreports.engine.util.JRStyledTextParser
  • http://community.jaspersoft.com/questions/536539/noclassdeffounderror-jrstyledtextparser-initialization-failure

我尝试了这些解决方案但没有成功.

I tried these solutions without success.

推荐答案

我在我的开发机器上遇到了同样的问题.基本上是由于应用服务器(Apache tomcat)出现问题

I've faced the same issue on my development machine. Basically it was happened due to problem in application server (Apache tomcat)

基本上我不小心删除了服务器根目录中的temp"文件夹.所以 jasper 无法编译报告并继续生成报告.

Basically I've accidentally deleted the "temp" folder in server root. So jasper cant compile the report and proceed with the report generation.

临时文件夹空间也会对报告生成过程造成巨大破坏.

Also temp folder space can make a huge damage to report generation process.

所以检查服务器中的以下项目

So check following items in the server

  1. 服务器空间
  2. tomcat 服务器中缺少文件夹

相关文章