{"id":2713,"date":"2022-08-30T15:27:09","date_gmt":"2022-08-30T15:27:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/08\/java-lang-noclassdeffounderror-net-sf-jasperreports-engine-util-jrstyledtextparser-initialization-failure-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:27:09","modified_gmt":"2022-08-30T15:27:09","slug":"java-lang-noclassdeffounderror-net-sf-jasperreports-engine-util-jrstyledtextparser-initialization-failure-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/java-lang-noclassdeffounderror-net-sf-jasperreports-engine-util-jrstyledtextparser-initialization-failure-collection-of-common-programming-errors\/","title":{"rendered":"java.lang.NoClassDefFoundError: net.sf.jasperreports.engine.util.JRStyledTextParser (initialization failure)-Collection of common programming errors"},"content":{"rendered":"<p>Good day,<\/p>\n<p>I have a web application which have a module to let user to download a report in excel file when click on a button.<\/p>\n<p>However, I have hit this error :<\/p>\n<pre><code>[10\/10\/13 20:21:48:332 MYT] 00000095 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet action: java.lang.NoClassDefFoundError: net.sf.jasperreports.engine.util.JRStyledTextParser (initialization failure)\n    at java.lang.J9VMInternals.initialize(J9VMInternals.java:176)\n    at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:121)\n    at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:88)\n    at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:103)\n    at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:61)\n    at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153)\n    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:82)\n    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653)\n    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:969)\n    at com.cv.report.service.impl.ReportServiceImpl.getReport(ReportServiceImpl.java:101)\n    at com.cv.report.service.core.AbstractReportExporter.getReport(AbstractReportExporter.java:69)\n    at com.cv.report.service.impl.ExcelExporter.exportAsByte(ExcelExporter.java:120)\n    at com.cv.report.service.core.AbstractReportExporter.export(AbstractReportExporter.java:53)\n    at com.cv.report.service.impl.ExcelExporter.export(ExcelExporter.java:82)\n    at com.cv.report.service.impl.ReportService.export(ReportService.java:53)\n    at com.cv.ibs.ccweb.report.ReportLastSuccessfulSignOnDateAction.performExport(ReportLastSuccessfulSignOnDateAction.java:121)\n    at com.cv.ibs.ccweb.report.ReportAction.executeOther(ReportAction.java:62)\n    at com.cv.ibs.ccweb.BaseAction.execute(BaseAction.java:487)\n    at com.cv.ibs.ccweb.report.ReportAction.execute(ReportAction.java:88)\n    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465)\n    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)\n    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)\n    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)\n    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)\n    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)\n    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)\n    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)\n    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)\n    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)\n    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)\n    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)\n    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)\n    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)\n    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)\n    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)\n    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)\n    at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)\n    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)\n    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)\n    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)\n    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)\n    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)\n    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)\n    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)\n    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)\n<\/code><\/pre>\n<p>I try to search from internet, but mostly talk about missing jar file in my class path issue. I checked my file in my environment, I think my jar files should be correct, the following is those jar files :<\/p>\n<ol>\n<li>commons-beanutils.jar<\/li>\n<li>commons-collections.jar<\/li>\n<li>commons-digester-2.1.jar<\/li>\n<li>commons-discovery-0.2.jar<\/li>\n<li>commons-logging-1.1.1.jar<\/li>\n<li>dom4j-1.6.1.jar<\/li>\n<li>iText-2.1.7.jar<\/li>\n<li>jakarta-regexp.jar<\/li>\n<li>jasperreports-4.7.0.jar<\/li>\n<li>jasperreports-applet-4.7.0.jar<\/li>\n<li>jasperreports-fonts-4.7.0.jar<\/li>\n<li>jasperreports-javaflow-4.7.0.jar<\/li>\n<li>jcommon-1.0.15.jar<\/li>\n<li>poi-3.8-20120326.jar<\/li>\n<li>poi-ooxml-3.8-20120326.jar<\/li>\n<li>poi-ooxml-schemas-3.8-20120326.jar<\/li>\n<li>stax-api-1.0.1.jar<\/li>\n<li>xmlbeans-2.3.0.jar<\/li>\n<\/ol>\n<p>I am working with RAD 8.5.5 with Struts framework. Before this, I am working on the same web application in RAD 7.0.<\/p>\n<p>RAD 7.0 is working fine with the button to download the report in excel file. However, when I transfer to RAD 8.5.5, I have hit this error.<\/p>\n<p>Kindly let me know if I provide wrong information.<\/p>\n<p>Kindly advise.<\/p>\n<ol>\n<li>\n<p>This could be caused by a failure to load AWT classes (JRStyledTextParser&#8217;s static init does GraphicsEnvironment.getLocalGraphicsEnvironment()).<\/p>\n<p>Add -Djava.awt.headless=true to the server Java process to confirm or infirm this possible cause.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-02-08 03:30:15. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Good day, I have a web application which have a module to let user to download a report in excel file when click on a button. However, I have hit this error : [10\/10\/13 20:21:48:332 MYT] 00000095 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet action: java.lang.NoClassDefFoundError: net.sf.jasperreports.engine.util.JRStyledTextParser (initialization failure) at java.lang.J9VMInternals.initialize(J9VMInternals.java:176) at [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2713","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2713"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2713\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}