Upgrading JasperReports 1.3.1 to JasperReports 4.6 - java

I am upgrading my JasperReports version as mentioned in the title.
I don't know much about the JasperReports version upgrade. Which all things I have to change to make it work. I have latest .jar files of everything. But when I print my .PDF report it gives me this error.
error:could not open file because its damaged or not supported.
In eclipse it shows this exception
java.lang.NoSuchFieldError: PRINTSCALING at
net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExpor‌​ter.java:532) at
net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java‌​:396) at
net.sf.jasperreports.engine.JasperExportManager.exportToPdf(JasperExportManager.‌​java:212) at
net.sf.jasperreports.engine.JasperExportManager.exportReportToPdf(JasperExportMa‌​nager.java:536) at
com.sibisoft.northstar.util.JasperReportGenerator.getPdfByteArray(JasperReportGe‌​nerator.java:679)
Please help me.

The issue is not with JasperReports but with the version of the iText library you are using. You need to download version 2.1.7 to work with that version of JasperReports. You can get it from here.
I happened to know this one off the top of my head, as I ran into it in the past, but as a helpful note in the future, this is the process I used to figure it out originally.
Since JasperReports is open source, the code can be found online easily. So I google:
site:grepcode.com
net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream
To find the code online. (GrepCode basically provides a cool site to look through many open source projects source code.)
At the top of the GrepCode page they have the version of the project, so make sure it is pointing to which ever version you are using.
Then find the method or line number in the error message.
From here it is just like debugging local code. You can see what the offending class is, and what package it belongs to. In this case it points to the itext libray as the culprit.
Hope that helps you out in the future, and happy reporting.

Related

JaCaMo cannot satisfy dependencies in Eclipse. Missing requirement

I am trying to follow the JaCaMo Eclipse Plugin instructions. I am getting a problem when installing a new software. Can anyone help? enter image description here
I tried to follow instructions but cannot solve the issue above. I have looked but cannot see anyone having the same problem.
I had the same issue. The problem is with the version of Eclipse. I'm assuming you're using a version that's 2021-12 or later. After the whole fiasco with Log4j at the end of 2021, I believe they stopped using it or changed something about it in Eclipse, and hence the error. Using Eclipse with versions 2021-09 or before will solve the issue.

Where has org.apache.batik.dom.svg.SVGDOMImplementation gone?

In the documentation for batik, it shows how to get an instance of the DOM implementation from the class org.apache.batik.dom.svg.SVGDOMImplementation.
However, after downloading Batik 1.8 from the same site, I cannot find this class anywhere.
I downloaded the 1.7 version and found it in batik-svg-dom.jar but it does not exist in the same jar within 1.8 (or as far as I can tell in any of the jars in that package).
Has this class been renamed / refactored / replaced? If so how do you get an instance of the DOM implementation in batik 1.8?
I found the answer, embedded in the maillist thread posted in #Ajay's answer.
It seems that in order to solve this bug, they have moved SVGDOMImplementation into package org.apache.batik.anim.dom, which lives in the jar file batik-anim-1.8.jar.
As at the time of writing, the batik web site had not yet been updated, and for some reason this change was also not highlighted in the release notes.
I'm having same issue, looks like we need to drop back to 1.7.. 1.8 is unstable as suggested in of the thread
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/201503.mbox/%3C5515BC93.90402#ptc.com%3E
I had the same issue with Apache Batik 1.8. The official binaries of that version are not compatible. To get the version 1.8 work I had to replace fop-transcoder-allinone-1.1.jar by fop-transcoder-allinone-2.2.jar which I took from Apache Batik 1.9.
Download binary of Apache Batik1.8 it makes life easier with above problem. Include only that in your project. That's enough. Here is the link.
Note that binaries are nothing but source code compiled into Java Archive files (JARs) they are the one's that execute on JVM.

Netbeans debugging error java.lang.ClassNotFoundException: org.apache.xerces.xni.XNIException

I'm using Netbeans 7.4 with Apache Tomcat to debug a servlet.
The Tomcat server is throwing an error:
java.lang.ClassNotFoundException: org.apache.xerces.xni.XNIException
I'm new to the Java thing, and I was asked to make changes to this app, but I can't get it to debug because of this error.
When I Google it, it shows as a bug in Netbeans, but I cannot find help on fixing the bug.
Does anyone have suggestions?
I assume you're referring to this.
https://netbeans.org/bugzilla/show_bug.cgi?id=232690
The bug history says this bug was fixed somewhere in July 2013.
I would try using the latest IDE version or pull a nightly build
(in which this bug's fix was reported as being available).
Then if you still see the bus is not fixed, you may want to contact the
Netbeans team providing all the details (which build you tested it
with, on which OS, how you reproduced the bug, etc.)

iText merge pdf error in Android, with latest libraries

I have read this question :
iText merge pdf error in Android
Which basically explains my problem, but the solution proposed - upgrading to the latest Android version of iText doesn't solve the issue.
I am using itextgoogle-5.4.0.jar, but I still get the same compile error.
Obviously when I get the project working I'll be happily paying the license fee, but the merging of PDF's is a requirement.
I have fixed this issue and re-uploaded 5.4.0 to the repository:
http://repo.itextsupport.com//android_gae/com/itextpdf/itextgoogle/5.4.0/
Could you confirm the fix?
There appears to be some compilation bugs in the iText port 5.4.0, it still has references to some of the java.awt classes. You'll notice this when you start using PdfContentByte.
I rolled back to the previous version 5.3.5 which is here :
http://repo.itextsupport.com//android_gae/com/itextpdf/itextgoogle/

What are the Working versions of Jars required in the Compilation of a report made with iReport 4.1.3

i made a couple of Reports using iReport 4.1.3 and i want to compile them through a java application.
but i don't know exactly the version of the jars that works with iReport 4.1.3.
i'm using the following jars :
commons-beanutils-core-1.8.0
commons-collections-3.1
commons-digester-2.0
commons-logging-1.1.1
groovy-all-1.0-jsr-02
itext-1.1.4
jasperreports- 3.1.4
and i get this Error while creating the reports from the Java Application :
Exception in thread "main"java.lang.NoSuchMethodError:com.lowagie.text.pdf.PdfWriter.setRgbTransparencyBlending(Z)V
so, can you please help, by Providing versions, or links.
Thank you very much for your time.
I use iText 2.1.5, in which com.lowagie.text.pdf.PdfWriter.setRgbTransparencyBlending(Z)V
is available.
As per your error, certainly problem is with your iText jar. Try out with the latest version of iText.

Categories

Resources