DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43651>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43651

           Summary: NPE without manually clearing image cache
           Product: Fop
           Version: 0.94
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: images
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: [EMAIL PROTECTED]


I use FOP in a stand alone application (Eclipse RCP) for Export (PDF, PS) AND
Print (direct awt print) from the same fop-sources. One and the same FopFactory
is used per application run.

The AWT-Print renderer is set up by:

PrintRenderer renderer = new PrintRenderer(printerJob);
renderer.setUserAgent(userAgent);
userAgent.setRendererOverride(renderer);

Each transformation type (print or export) works for its own.
Doing an export followed by a print transformation (or the way around) of the
same source results in a NullPointerExeption for each Image. Please see the
stack trace below.

In other words:
If you start with an export you can always do a successfull export, but never an
awt-print.
If you start with an awt-print you can always do a successfull awt-print but
never an export.

Manually clearing the ImageCache solves the problem.
As the API of org.apache.fop.image.ImageFactory.clearCaches() points out, this
must be an issue.

The URLs does not change between the fop-runs.
Its protocol is OSGI-specific and shouldn't be the source
of the problem. Similar URLs work perfect in all other parts of the application
and with clearing the ImageCache too.


Stack trace following:




18.10.2007 17:30:49 org.apache.fop.image.JpegImageIOImage loadBitmap
SCHWERWIEGEND: Error while loading image: null
java.lang.NullPointerException
        at 
org.apache.fop.image.JpegImageIOImage.loadBitmap(JpegImageIOImage.java:64)
        at org.apache.fop.image.AbstractFopImage.load(AbstractFopImage.java:169)
        at 
org.apache.fop.render.java2d.Java2DRenderer.drawImage(Java2DRenderer.java:926)
        at
org.apache.fop.render.AbstractPathOrientedRenderer.drawImage(AbstractPathOrientedRenderer.java:678)
        at 
org.apache.fop.render.java2d.Java2DRenderer.renderImage(Java2DRenderer.java:882)
        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.AbstractRenderer.renderLineArea(AbstractRenderer.java:606)
        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.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.java2d.Java2DRenderer.print(Java2DRenderer.java:991)
        at sun.print.RasterPrinterJob.printPage(Unknown Source)
        at sun.print.RasterPrinterJob.print(Unknown Source)
        at sun.print.RasterPrinterJob.print(Unknown Source)
        at 
org.apache.fop.render.print.PrintRenderer.stopRenderer(PrintRenderer.java:143)
        at 
org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:245)
        at 
org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:283)
        at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.endDocument(TransformerIdentityImpl.java:962)
        at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown 
Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown 
Source)
        at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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 de.tragwerk.xtrn.fop.internal.FopPrintJob.run(FopPrintJob.java:111)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
18.10.2007 17:30:49 org.apache.fop.render.java2d.Java2DRenderer drawImage
WARNUNG: Loading of bitmap failed: bundleentry://706/xsl/Anordnung.jpg
18.10.2007 17:30:49 org.apache.fop.image.JpegImageIOImage loadBitmap

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to