daust / JasperReportsIntegration

JasperReportsIntegration provides an interface to use the JasperReports reporting engine in an Oracle database application, specifically with Oracle Application Express (Oracle APEX).
BSD 3-Clause "New" or "Revised" License
55 stars 23 forks source link

Barcodes produce classnotfounderror #55

Closed daust closed 3 years ago

daust commented 3 years ago

When running a barcode you might receive the following error:

bf5dbb1e2101.png)javax.servlet.ServletException: Servlet execution threw an exception
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
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:184)
    net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.evaluateBarcodeRenderable(AbstractBarcodeEvaluator.java:124)

It seems to be related to a library conflict.

daust commented 3 years ago

I have included the serializer-2.7.1.jar into the jri.war file with the gradle commands:

    // https://mvnrepository.com/artifact/xalan/serializer
    // see bug: #55 - Barcodes produce classnotfounderror
    compile group: 'xalan', name: 'serializer', version: '2.7.1'
    // https://mvnrepository.com/artifact/org.apache.xmlgraphics/xmlgraphics-commons
    // see bug: #55 - Barcodes produce classnotfounderror
    compile group: 'org.apache.xmlgraphics', name: 'xmlgraphics-commons', version: '2.+'

Actually, I needed both the serializer and the xmlgraphics libraries. I was hitting another missing class error.