Re: [XSL-FO] Malformed PDF
- mcgm2002es wrote:
> We have an application based on Websphere, Java and Struts whichThat isn't much information to go on, but it is easy to run into a
> builds pdf documents through xml-templates (created with Apache-
> Velocity) as input for FOP 0.20.3.
> All works fine (6 months develop and 1 production), but today we got
> malformed pdf files (acrobat cannot open them) and an only line in
> the log:
> "Exception : Rebuild failed: trailer not found.; Original message:
> PDF startxref not found."
> We had to stop and restart the app instance in Websphere.
> Somebody know what is happening?
transient problem with opening files by running out of file handles.
Even if you don't have file objects left open (which will certainly
cause trouble and you either have a bug or need to increase the number
of open files allowed for the process), it is common for the JVM to not
try a GC before failing when it gets an "out of file descriptors" error
from the OS.
An easy thing to try is to invoke System.gc() and perhaps
System.runFinalization() once and a while (perhaps once before and once
after the PDF is generated).
It is common in production environments to "bounce" the JVM regularly
(daily or weekly depending on your load) to clear out any bit rot.
"I love deadlines. I love the whooshing sound they make as they fly by."
-- Douglas Adams