Jasper report with upgraded iText 5.x or 7.x

0

Hi Team, 

I am unable to create a PDF with jasperSoft(6.17.0) with iTextPdf(5.x or 7.x) due to below error.

java.lang.NoClassDefFoundError: com.lowagie.text.DocumentException
    at net.sf.jasperreports.export.pdf.classic.ClassicPdfProducerFactory.createProducer(ClassicPdfProducerFactory.java:44)
    at net.sf.jasperreports.engine.export.JRPdfExporter.createPdfProducer(JRPdfExporter.java:808)
    at net.sf.jasperreports.engine.export.JRPdfExporter.initExport(JRPdfExporter.java:704)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:665)

 

Below approaches has been tried by me.

1) JRPdfExporter exporter = new JRPdfExporter();

exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(fileTemp));

exporter.exportReport();

also tried with below code 

2) JasperExportManager.exportReportToPdf(jasperPrint);

but still facing same issue whenever i have excluded this version(com.lowagie) of text in my POM.xml

<dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.17.0</version>
            <exclusions>
                <exclusion>
                    <groupId>com.lowagie</groupId>
                    <artifactId>itext</artifactId>
                </exclusion>
            </exclusions>
        </dependency> 
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.12</version> 
        </dependency>

and no other jar in my classpath except iTextpdf 5.5.12 and jasper 6.17.0 for this.

Could you please help me to resolve this issue and able to create PDF with latest version of iText.

Thanks 

Ashish

also tries 

akashish021's picture
Joined: Sep 13 2021 - 2:05am
Last seen: 4 days 1 hour ago

the latest version of jasper reports library comes with itext-2.1.7.js8. So, maybe they are incompatible

gustavofarias - 1 week 5 days ago

Hi, I'm having the same problem in my deployed web app. Still searching for some help.

I just face this problem in my deployed web app, because, when I run my app on localhost it works good. I cannot resolve the problem. Hope you get the workaround to this soon.

davidisaacdc - 2 days 11 hours ago

0 Answers:

No answers yet
Feedback