Error generating barcode using JasperSoft

0

Trying to generate barcodes of products, using Barcode4j 2.1 of JasperSoft 6.5.1 , but when running on the JSF page of this error:

   javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/batik/bridge/UserAgent

And it displays the blank PDF.

IntheJasperSoftprogram,younormallydisplaythePDFwiththecode.

CodigoBarras.jrxml

<componentElement><reportElementx="15" y="23" width="100" height="30" uuid="9127b2ca-8116-450e-a692-7c17bdd12b43"/>
            <jr:Codabar xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                <jr:codeExpression><![CDATA[$F{codigobarra}]]></jr:codeExpression>
            </jr:Codabar>
        </componentElement>

The classe.java that runs the .jasper is normal, I use it in other prints and PDF generation.

    
asked by anonymous 22.06.2018 / 04:36

1 answer

1

Check that your pom.xml has the dependency batik-bridge :

<dependency>
    <groupId>batik</groupId>
    <artifactId>batik-bridge</artifactId>
    <version>1.6</version>
</dependency>

Also make sure you are using fonts.jar

 <dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports-fonts</artifactId>
    <version>6.0.0</version>
</dependency>
    
22.06.2018 / 16:35