nlasystems Posted September 11 Share Posted September 11 Hi I wrote this little java program that takes a jasper report, fills it and displays it in the jasper viewer. It works just fine but when I press on the "Save" icon in the viewer and try to save a pdf version of the report I get the error below and a blank pdf file is saved. I am using the following libraries (among others). Any hints to what is going here is greatly appreciated. itext-2.1.7.js4.jar jasperreports-6.21.2.jar jasperreports-fonts-6.21.2.jar openpdf-1.3.26.jar pdfbox-1.8.8.jar Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: com.lowagie.text.Phrase.add(Lcom/lowagie/text/Element;)Z at net.sf.jasperreports.export.pdf.classic.ClassicPhrase.add(ClassicPhrase.java:56) at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:2270) at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.renderParagraph(SimplePdfTextRenderer.java:184) at net.sf.jasperreports.engine.export.AbstractTextRenderer.render(AbstractTextRenderer.java:389) at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.render(SimplePdfTextRenderer.java:122) at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2552) at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1289) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:1224) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:1117) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:680) at net.sf.jasperreports.view.save.JRPdfSaveContributor.save(JRPdfSaveContributor.java:113) at net.sf.jasperreports.swing.JRViewerToolbar.btnSaveActionPerformed(JRViewerToolbar.java:422) at net.sf.jasperreports.swing.JRViewerToolbar$1.actionPerformed(JRViewerToolbar.java:138) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Link to comment Share on other sites More sharing options...
Solution Lucian Chirita Posted September 11 Solution Share Posted September 11 JasperReports 6.21.2 depends on OpenPDF 1.3.32. Remove the itext jar from your application (as it contains the same packages/classes as OpenPDF) and upgrade the openpdf jar to 1.3.32. Regards, Lucian 1 Link to comment Share on other sites More sharing options...
nlasystems Posted October 3 Author Share Posted October 3 Thanks. That was helpful. 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