Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

JasperReports Integration and QR code throws exception #8

rv8470 · · author
#1

I am using the Integration Kit 2.4.0. with a Jasper Report build in 6.10.0.
When I use the QR Code then it runs fine in the preview but not in APEX (19.1)
Is there something I need to add or install?

The error is
java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker

Complete Browser error

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Servlet execution threw an exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:818)
net.sf.jasperreports.components.barcode4j.QRCodeSVGImageProducer.createImage(QRCodeSVGImageProducer.java:171)
net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.evaluateBarcodeRenderable(AbstractBarcodeEvaluator.java:109)
net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.visitQRCode(AbstractBarcodeEvaluator.java:516)
net.sf.jasperreports.components.barcode4j.QRCodeComponent.receive(QRCodeComponent.java:49)
net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.evaluateBarcode(AbstractBarcodeEvaluator.java:85)
net.sf.jasperreports.components.barcode4j.BarcodeFillComponent.evaluateBarcode(BarcodeFillComponent.java:83)
net.sf.jasperreports.components.barcode4j.BarcodeFillComponent.evaluate(BarcodeFillComponent.java:70)
net.sf.jasperreports.engine.fill.JRFillComponentElement.evaluate(JRFillComponentElement.java:110)
net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:381)
net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:500)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:427)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVerticalFiller.java:388)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:249)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:115)
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:582)
net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:90)
net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:286)
de.oc.integration.jasper.webapp.ReportWrapper.service(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalker
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:818)
net.sf.jasperreports.components.barcode4j.QRCodeSVGImageProducer.createImage(QRCodeSVGImageProducer.java:171)
net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.evaluateBarcodeRenderable(AbstractBarcodeEvaluator.java:109)
net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.visitQRCode(AbstractBarcodeEvaluator.java:516)
net.sf.jasperreports.components.barcode4j.QRCodeComponent.receive(QRCodeComponent.java:49)
net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.evaluateBarcode(AbstractBarcodeEvaluator.java:85)
net.sf.jasperreports.components.barcode4j.BarcodeFillComponent.evaluateBarcode(BarcodeFillComponent.java:83)
net.sf.jasperreports.components.barcode4j.BarcodeFillComponent.evaluate(BarcodeFillComponent.java:70)
net.sf.jasperreports.engine.fill.JRFillComponentElement.evaluate(JRFillComponentElement.java:110)
net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:381)
net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:500)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:427)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVerticalFiller.java:388)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:249)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:115)
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:582)
net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:90)
net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:286)
de.oc.integration.jasper.webapp.ReportWrapper.service(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/8.5.20

  • replies 4
  • views 576
  • likes 0
#2

Hi, did you manage to solve your problem?

I copied the serializer-2.7.1.jar file into the /var/lib/tomcat/webapps/JasperReportsIntegration/WEB-INF/lib folder and the error message no longer appears, but neither does the QR Code.

#3

Hi,
After some research I managed to successfully print my precious QR Code!

To achieve this I did the following steps:
1 - Download and copy de file serializer-2.7.1.jar to the folder:
/var/lib/tomcat/webapps/JasperReportsIntegration/WEB-INF/lib on the server.

2 - Edit the file /var/lib/tomcat/webapps/JasperReportsIntegration/WEB-INF/classes/jasperreports.properties and added the line:
net.sf.jasperreports.components.barcode4j.image.producer=image

3 - DONE, the QR Code appears in the report!

I hope this can help someone in the future.

Sources: https://stackoverflow.com/questions/25200599/tomcat-after-undeploy-deploy-a-war-makes-noclassdeffounderror-org-apache-xml-se and https://stackoverflow.com/questions/36298271/jasperserver-qrcode-not-visible-in-generated-report/36400420#36400420

Dietmar Aust daust · · moderators
#4
daust added the waiting for reply from reporter label
#5