Error generating barcode using Jaspersoft

Asked

Viewed 105 times

0

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

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

And display the blank PDF.

inserir a descrição da imagem aqui

Since, in the program Jaspersoft normally displays the PDF with the code.

CodigoBarras.jrxml

        <componentElement>
            <reportElement x="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>

To classe.java that runs the . Jasper is normal, I use in other prints and PDF generation.

1 answer

1

Check whether in your pom.xml has dependence batik-bridge:

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

Also make sure you’re using fonts.jar

 <dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports-fonts</artifactId>
    <version>6.0.0</version>
</dependency>
  • Allan Braga, already has these two dependencies in the pom, I thought with them already solved the problem

  • Didn’t solve the problem ? Because this problem is related to lack of library...

  • I solved using barbecue instead of the barcode4J. Obliged

Browser other questions tagged

You are not signed in. Login or sign up in order to post.