Jump to content
We've recently updated our Privacy Statement, available here ×

Error: Linux + PDF Generation


Recommended Posts

By: Jon Klem - jkle44

Error: Linux + PDF Generation

2003-11-20 15:23

I've trolled all available posts to see if anybody was having a similar problem but was unable to find a match.

 

We are using jasperreports .5 and iText 1.01 on RH 8/Tomcat 4.1. Our site makes heavy use of PDF generation using jasperrepots. After several days of usage (following a tomcat restart), the pdf generation starts failing, not always in the same way though.

 

Since upgrading the jasper .5 and iText 1.01 the problems appeared to have gone away but now, after a week of trouble-free performance they reappeared.

 

More of the stacktrace is included at the bottom of this post but the message we get is "ExceptionConverter: java.io.IOException: The document has no pages."

 

Problems we've had debugging this:

 

1) This solution seemed to work fine on a previous Tomcat3/Sun Solaris host (ran without ever encountering these problems)

 

2) We either email the PDF or send it to the screen as a preview. The preview functionality never fails. It is using basically the same code to generate the PDF. We are just redirecting the stream to the screen instead of using it to construct an email.

 

3) This only happens on our Linux host (never during Windows 2K development) under heavy load so it is difficult to reproduce and even harder to debug. The rest of the site functions without problems even after the PDF generation has entered into this volatile state.

 

4) Restarting tomcat always fixes the problem, at least temporarily.

 

Any help or direction would be greatly appreciated. I would be loathe to have to abandon this great software over this thorny issue.

 

Thanks

 

Jon Klem

 

ExceptionConverter: java.io.IOException: The document has no pages.

at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source)

at com.lowagie.text.pdf.PdfWriter.close(Unknown Source)

at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)

at com.lowagie.text.Document.close(Unknown Source)

at dori.jasper.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:343)

at dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:228)

at dori.jasper.engine.JasperExportManager.exportReportToPdf(JasperExportManager.java:187)

at dori.jasper.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:283)

 

 

 

 

 

 

By: Paulo Soares - psoares33

RE: Error: Linux + PDF Generation

2003-11-25 07:15

The exception you see is the consequence not the cause. It says that you have a document without anything written, something happened before. Check for cought exceptions that output no messages and the System.out and System.err logs.

 

 

 

 

By: Teodor Danciu - teodord

RE: Error: Linux + PDF Generation

2003-11-28 12:53

 

Hi,

 

We had this problem on a previous version of

JasperReport and Paulo provided us with the solution:

 

https://sourceforge.net/forum/message.php?msg_id=2064554

 

The fix was added in the 0.5.0 version, but I'm afraid

I did not handle all the situations.

If I understand correctly, with recent versions of

iText we cannot create PDF documents witout any

page inside anymore.

 

I think in your case, from time to time,

your application creates empty documents probably

due to the fact that there are no records in the data

source of the report and you have whenNoDataType="NoPages", which is the default.

 

One solution is to use whenNoDataType="BlankPage".

But I think we should also fix the PDF exporter to

create at least one page even when the JasperPrint

object has no pages inside.

 

Thank you,

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...