Apache FOP crashes with NullPointerException

Bug #277173 reported by Shaw Terwilliger on 2008-10-02
0
Affects Status Importance Assigned to Milestone
openjdk-6 (Debian)
Fix Released
Unknown
openjdk-6 (Ubuntu)
Medium
Unassigned

Bug Description

I'm not sure if this bug needs logged against Ubuntu's OpenJDK project because a similar issue is logged in Debian's bug list as #447951 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447951). I couldn't find a statement about what qualifies as "up-stream" for the OpenJDK packages, but this appears to the an identical problem.

To summarize from the Debian bug, I'm running Apache FOP with openjdk-6-jdk on AMD64 (version 6b11-2ubuntu2, but 6b11-2ubuntu3~ppa1 from the PPA acts the same) and I see a NullPointerException when processing documents with FOP when an image is inlined. I don't get this error with Sun's 64-bit JDK 1.6.0_03-b05 (later updates are problematic with Eclipse so I haven't tested them).

I can supply the FO input document if that would help (it simply inlines one PNG). The Debian bug has an FO document attached.

hansen:trunk/docbook% ./tools/fop-0.94/fop -c fop-config.xml -fo out/plugin-user-guide/xsl-fo-usletter/plugin-user-guide-usletter.xml -pdf foo.pdf
Oct 2, 2008 11:40:04 AM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
SEVERE: Couldn't find hyphenation pattern en
Oct 2, 2008 11:40:05 AM org.apache.fop.layoutmgr.inline.LineLayoutManager$LineBreakingAlgorithm updateData2
WARNING: Line 1 of a paragraph overflows the available area. (fo:block, location: 35/131)
Oct 2, 2008 11:40:05 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.NullPointerException
 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
 at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
 at org.apache.fop.cli.Main.startFOP(Main.java:166)
 at org.apache.fop.cli.Main.main(Main.java:197)

---------

java.lang.NullPointerException
 at org.apache.fop.render.pdf.FopPDFImage.setup(FopPDFImage.java:144)
 at org.apache.fop.pdf.PDFDocument.addImage(PDFDocument.java:794)
 at org.apache.fop.render.pdf.PDFRenderer.putImage(PDFRenderer.java:1725)
 at org.apache.fop.render.pdf.PDFRenderer.renderImage(PDFRenderer.java:1652)
 at org.apache.fop.render.AbstractRenderer.renderViewport(AbstractRenderer.java:748)
 at org.apache.fop.render.AbstractPathOrientedRenderer.renderViewport(AbstractPathOrientedRenderer.java:541)
 at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:631)
 at org.apache.fop.render.pdf.PDFRenderer.renderInlineArea(PDFRenderer.java:1316)
 at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:606)
 at org.apache.fop.render.pdf.PDFRenderer.renderLineArea(PDFRenderer.java:1307)
 at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:532)
 at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:582)
 at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:1300)
 at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:522)
 at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:582)
 at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:1300)
 at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:522)
 at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:427)
 at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:406)
 at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:340)
 at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:285)
 at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:258)
 at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:232)
 at org.apache.fop.render.pdf.PDFRenderer.renderPage(PDFRenderer.java:757)
 at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:120)
 at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:424)
 at org.apache.fop.layoutmgr.PageSequenceLayoutManager.makeNewPage(PageSequenceLayoutManager.java:377)
 at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:492)
 at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:398)
 at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:420)
 at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:370)
 at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:262)
 at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:345)
 at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:263)
 at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:144)
 at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:233)
 at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:145)
 at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
 at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
 at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
 at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
 at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
 at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
 at org.apache.fop.cli.Main.startFOP(Main.java:166)
 at org.apache.fop.cli.Main.main(Main.java:197)

Description: Ubuntu 8.04.1
Release: 8.04

Shaw Terwilliger (sterwill) wrote :
Shaw Terwilliger (sterwill) wrote :

In case anyone is confused when they read the draft.mode work-around in the Debian bug, I'll try to explain here.

The Debian bug reporter's FO document did not originally contain images. When FOP produces a draft output (draft.mode=yes), it inserts a background image that says "DRAFT" or something like it on each page, as a sort of watermark. This image insertion causes his crash.

My input documents do contain images (screenshots of our software), so disabling draft mode (and removing the background image) doesn't help me. They still contain images, and FOP crashes.

Shaw Terwilliger (sterwill) wrote :

I just tried Apache FOP 0.95 (my bug report was for 0.94) and the problem seems to be fixed in FOP. Upgrading to 0.95 is a fine work-around for me, but I think there's still an issue that OpenJDK 6 causes (or enables or whatever) the NPE with 0.94 where Sun's JVM does not.

I'm also a bit confused by the Apache FOP bug report for this bug (https://issues.apache.org/bugzilla/show_bug.cgi?id=44965). It mentions an OpenJDK release missing a color profile, but I appear to have them all, which makes me suspect it's another issue (but perhaps still an FOP bug and not an OpenJDK one).

hansen:~% d /usr/lib/jvm/java-6-openjdk/jre/lib/cmm/
total 256
-rw-r--r-- 1 root root 784 2008-08-04 05:09 CIEXYZ.pf
-rw-r--r-- 1 root root 556 2008-08-04 05:09 GRAY.pf
-rw-r--r-- 1 root root 488 2008-08-04 05:09 LINEAR_RGB.pf
-rw-r--r-- 1 root root 234080 2008-08-04 05:09 PYCC.pf
-rw-r--r-- 1 root root 6876 2008-08-04 05:09 sRGB.pf

Matthias Klose (doko) on 2008-10-09
Changed in openjdk-6:
importance: Undecided → Medium
status: New → Triaged
Changed in openjdk-6:
status: Unknown → Confirmed
Changed in openjdk-6 (Debian):
status: Confirmed → Fix Released
Jeremy Kerr (jk-ozlabs) wrote :

Just tried this on precise: looks to be fixed in openjdk-6-jre (6b24~pre3-0ubuntu1) but broken in openjdk-7-jre (7~b147-2.0-1ubuntu2)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.