fgomes1983 Posted September 16, 2010 Share Posted September 16, 2010 I'm using Jasper Report 3.7.4 with iText 5.0.4...I'm getting the following error: java.lang.NoClassDefFoundError: com/lowagie/text/DocumentException at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:158) What could it be ? Thanks in advance... Link to comment Share on other sites More sharing options...
szaharia Posted September 16, 2010 Share Posted September 16, 2010 Taking into account the iText 5 license terms of use, the JR library is still compatible with iText-2.1.7. jar. Try to use this jar instead of iText-5.0.4.Hope this helps,sandaPost Edited by shertage at 09/16/2010 10:19 Link to comment Share on other sites More sharing options...
fgomes1983 Posted September 16, 2010 Author Share Posted September 16, 2010 The iText package names changed from com.lowagie to com.itextpdf... But Jasper looks for com.lowagie...Is there any way to tell Jasper to search the current package? Link to comment Share on other sites More sharing options...
svenn Posted September 16, 2010 Share Posted September 16, 2010 The question is why do you need to use the latest one instead of the one that is compatible with Jasper? Link to comment Share on other sites More sharing options...
fgomes1983 Posted September 16, 2010 Author Share Posted September 16, 2010 Because with the latest one I'm getting this error...I thought it was something wrong with Adobe Reader, but talking on the forum I realized it could be a problem with itextI suspect there is something wrong with iText... Post Edited by fgomes1983 at 09/16/2010 16:38 Link to comment Share on other sites More sharing options...
szaharia Posted September 17, 2010 Share Posted September 17, 2010 This is one of the 5.0.4 problems, indeed. Package names are changed. But you could still download JR sources from here, then replace the iText 2.1.7 jar with the 5.0.4 one, then replace the iText package names in the following JR classes: JRPdfExporter JRPdfExporterContext JRPdfExporterParameter JRPdfExporterTagHelper BreakIteratorSplitCharacterthen modify the version of the iText dependency in the pom.xml file, and rebuild the project in order to get a new JR jar.And first of all, find out if your app may use an AGPL licensed library.Hope this helps,sanda Link to comment Share on other sites More sharing options...
stevesobol Posted January 20, 2014 Share Posted January 20, 2014 OK, so the first thing I thought when I read this thread was "Why on earth would they be using an ancient version of iText" -- but having looked at the AGPL (which I'd heard of, but am not familiar with), NOW I understand why. So, the next logical question is... It seems that there weren't many (or ANY) iText alternatives when this question was posted over three years ago, but maybe Apache PDFbox might work now? Any thoughts about adapting Jasper to use it? The Apache license is much more permissive than the AGPL. Link to comment Share on other sites More sharing options...
stevesobol Posted January 20, 2014 Share Posted January 20, 2014 (Sorry, posted this as a comment by accident!) OK, so the first thing I thought when I read this thread was "Why on earth would they be using an ancient version of iText" -- but having looked at the AGPL (which I'd heard of, but am not familiar with), NOW I understand why. So, the next logical question is... It seems that there weren't many (or ANY) iText alternatives when this question was posted over three years ago, but maybe Apache PDFbox might work now? Any thoughts about adapting Jasper to use it? The Apache license is much more permissive than the AGPL. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now