The PDF Renderer issues a stack trace handling bitmap images. This also prohibits subsequent renderings of files without bitmap images. org.apache.fop.apps.FOPException: 921600 at org.apache.fop.apps.Driver.render(Unknown Source) at org.apache.fop.apps.Driver.run(Unknown Source) ... java.lang.ArrayIndexOutOfBoundsException: 921600 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111) at org.apache.fop.apps.Driver.render(Unknown Source) at org.apache.fop.apps.Driver.run(Unknown Source)
Excuse me, but without seeing details (see http://nagoya.apache.org/bugzilla/bugwritinghelp.html) I would consider the bug as INVALID. Provide a reproducible example, please.
Created attachment 3921 [details] example fo which exhibits the problem
Works fine for me, of course except for http://doradb1/dora/MediaContentHandler?type=image&id=1&mimetype=image/jpeg Chances are the problem is there. Try to run without this image, if it helps, check that MediaContentHandler returns image correctly (mime-type, content-length etc).
Created attachment 3926 [details] Correct sample which exhibits the problem.
Created attachment 3927 [details] Example servlet which retrieves images.
Using the provided example servlet, RetrieveImage, I can successfully retrieve an image to the browser. However, using the example fo provided, I cannot successfully retrieve the image to a pdf document.
Your servlet works very inaccurately with those buffers: byte[] chunk = new byte[4096]; while (fis.read(chunk) > 0) { dos.write(chunk); } Think what a garbage you are outputting in a very last iteration. When you are copying buffers always make sure you are writing the same amount of bytes you are reading. Use the following pattern: int bytesRead; byte[] chunk = new byte[4096]; while ((bytesRead = fis.read(chunk)) > 0) { dos.write(chunk, 0, bytesRead); }
RetrieveImage was simply meant as an example (cut and paste from the "real" code). I guess that's what I get for not looking at it thoroughly. The corrected stream read/write "fixed" the problem. Thanks Oleg for your diligence.
batch transition to closed remaining pre-FOP1.0 resolved bugs