[jira] [Updated] (FOP-2914) NPE during FO 2 IF transformation with instream-foreign-object using Saxon

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (FOP-2914) NPE during FO 2 IF transformation with instream-foreign-object using Saxon

Jiri Ondrusek (Jira)

     [ https://issues.apache.org/jira/browse/FOP-2914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

M.H. updated FOP-2914:
----------------------
    Description:
So far, we used Xalan (2.7.2) as the XSLT Processor to transform our XML/XSL to FO and further to IF (intermediate format) to concat these to one file that is finally rendered to PDF (to avoid multiple fonts via PDF concatenation). We now have a current version of a 3rd party library that breaks our app because of Xalan  (known bug: [https://stackoverflow.com/questions/45152707/transformerfactory-and-xalan-dependency-conflict]) . So we investigated a lot of time, adjusted our XMl APIs, converted to JAXB, removed Xalan and werent able to use the JDK 11 internal XSLT processor because our (hundreds of) XSLTs don't work anymore because they only seem to work with a "lazy" XSLT processor like Xalan. For this reason, we evaluate the Saxon XSLT processor. With *Saxon*, most things work again except one bug:

We (have to) include SVG files with instream-foreign-object:
{code:xml}
<fo:instream-foreign-object>
  <svg:svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="120mm" height="120mm" >
    <svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Test.svg" width="120mm" height="120mm"/>
  </svg:svg>
</fo:instream-foreign-object>
{code}
And during the transformation of the FO to Apaches intermediate format IF, a NullPointerException occurs:
{code:java}
Error while rendering page 1. Reason: java.lang.NullPointerException     at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:74)     at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:173)     at com.sun.proxy.$Proxy11.pageRenderingError(Unknown Source)     at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:206)     at org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:174)     at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:146)     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:243)     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:287)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.makeNewPage(PageSequenceLayoutManager.java:192)     at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:633)     at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:511)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:659)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:604)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:599)     at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:338)     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:458)     at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:143)     at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)     at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)     at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)     at de.icomps.xml.FOP$HandlerXML.endElement(FOP.java:1624)     at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:412)     at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:185)     at net.sf.saxon.event.SequenceNormalizer.endElement(SequenceNormalizer.java:230)     at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:528)     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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)     at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:435)     at net.sf.saxon.event.Sender.send(Sender.java:167)     at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:368)     at de.icomps.xml.FOP.transformFO(FOP.java:1055)     at de.icomps.xml.FOP.fo2IF(FOP.java:789)     at de.icomps.rep.Report.createWithFOP(Report.java:3772)     at de.icomps.rep.Report.processReport(Report.java:2078)     at de.icomps.rep.ReportClient.createClientReport(ReportClient.java:266)     at de.icomps.rep.ReportClientMulti.genClientReportSingle(ReportClientMulti.java:2537)     at de.icomps.rep.ReportClientMulti.genClientReports(ReportClientMulti.java:1804)     at de.icomps.rep.ReportClientMulti.createReport(ReportClientMulti.java:288)     at de.icomps.rep.Report.startProcessing(Report.java:1548)     at de.icomps.ijs.JobTask.startJob(JobTask.java:412)     at de.icomps.ijs.JobTask.run(JobTask.java:154)     at java.base/java.lang.Thread.run(Thread.java:834)    Caused by: java.lang.NullPointerException     at net.sf.saxon.event.ReceivingContentHandler.getNodeName(ReceivingContentHandler.java:485)     at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:398)     at org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:185)     at org.apache.fop.util.DOM2SAX.writeNode(DOM2SAX.java:263)     at org.apache.fop.util.DOM2SAX.writeDocument(DOM2SAX.java:73)     at org.apache.fop.render.intermediate.IFSerializer.drawImage(IFSerializer.java:508)     at org.apache.fop.render.intermediate.IFRenderer.renderForeignObject(IFRenderer.java:1312)     at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:864)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:831)     at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:862)     at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:717)     at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)     at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:692)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:573)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:756)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:601)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:459)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:784)     at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:436)     at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:360)     at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)     at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)     at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:272)     at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:245)     at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)     at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:193)     ... 48 more
{code}
Trying 
{code:xml}
<fo:external-graphic height="120mm" width="120mm" src="Test.svg"/>  {code}
the error does not occur, but the output is wrong (SVG is not displayed correctly - this is the case since FOP 0.95, etc.).

We tested with our current FOP 2.3 and also with the latest FOP 2.4; used different SVG files, fiddled with several parameters of instream-foreign-object / svg:svg / svg: image, ....always  same error.

So we end up not being able to use the JDK internal XSLT or Xalan XSLT processor and are stuck with Saxon at this single NullPointerException during FO to IF transaformation. We spend yesterday the whole day (!) search for solutions / workarounds on the web but the only hint we found was something with namespaces or empty URIs.

We tried to create a reproducable case with "fop.bat" and plain FOP directory (original, without Xalan, without Xalan and with Saxon), same OpenJDK,  create single scripts to transform FO to IF and IF to PDF, but the bug didn't occur! So, it seems it only accours when using the Java API.

  was:
So far, we used Xalan (2.7.2) as the XSLT Processor to transform our XML/XSL to FO and further to IF (intermediate format) to concat these to one file that is finally rendered to PDF (to avoid multiple fonts via PDF concatenation). We now have a current version of a 3rd party library that breaks our app because of Xalan  (known bug: [https://stackoverflow.com/questions/45152707/transformerfactory-and-xalan-dependency-conflict]) . So we investigated a lot of time, adjusted our XMl APIs, converted to JAXB, removed Xalan and werent able to use the JDK 11 internal XSLT processor because our (hundreds of) XSLTs don't work anymore because they only seem to work with a "lazy" XSLT processor like Xalan. For this reason, we evaluate the Saxon XSLT processor. With *Saxon*, most things work again except one bug:

We (have to) include SVG files with instream-foreign-object:
{code:xml}
<fo:instream-foreign-object>
  <svg:svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="120mm" height="120mm" >
    <svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Test.svg" width="120mm" height="120mm"/>
  </svg:svg>
</fo:instream-foreign-object>
{code}
And during the transformation of the FO to Apaches intermediate format IF, a NullPointerException occurs:
{code:java}
Error while rendering page 1. Reason: java.lang.NullPointerException     at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:74)     at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:173)     at com.sun.proxy.$Proxy11.pageRenderingError(Unknown Source)     at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:206)     at org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:174)     at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:146)     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:243)     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:287)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.makeNewPage(PageSequenceLayoutManager.java:192)     at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:633)     at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:511)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:659)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:604)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:599)     at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:338)     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:458)     at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:143)     at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)     at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)     at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)     at de.icomps.xml.FOP$HandlerXML.endElement(FOP.java:1624)     at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:412)     at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:185)     at net.sf.saxon.event.SequenceNormalizer.endElement(SequenceNormalizer.java:230)     at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:528)     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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)     at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:435)     at net.sf.saxon.event.Sender.send(Sender.java:167)     at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:368)     at de.icomps.xml.FOP.transformFO(FOP.java:1055)     at de.icomps.xml.FOP.fo2IF(FOP.java:789)     at de.icomps.rep.Report.createWithFOP(Report.java:3772)     at de.icomps.rep.Report.processReport(Report.java:2078)     at de.icomps.rep.ReportClient.createClientReport(ReportClient.java:266)     at de.icomps.rep.ReportClientMulti.genClientReportSingle(ReportClientMulti.java:2537)     at de.icomps.rep.ReportClientMulti.genClientReports(ReportClientMulti.java:1804)     at de.icomps.rep.ReportClientMulti.createReport(ReportClientMulti.java:288)     at de.icomps.rep.Report.startProcessing(Report.java:1548)     at de.icomps.ijs.JobTask.startJob(JobTask.java:412)     at de.icomps.ijs.JobTask.run(JobTask.java:154)     at java.base/java.lang.Thread.run(Thread.java:834)    Caused by: java.lang.NullPointerException     at net.sf.saxon.event.ReceivingContentHandler.getNodeName(ReceivingContentHandler.java:485)     at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:398)     at org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:185)     at org.apache.fop.util.DOM2SAX.writeNode(DOM2SAX.java:263)     at org.apache.fop.util.DOM2SAX.writeDocument(DOM2SAX.java:73)     at org.apache.fop.render.intermediate.IFSerializer.drawImage(IFSerializer.java:508)     at org.apache.fop.render.intermediate.IFRenderer.renderForeignObject(IFRenderer.java:1312)     at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:864)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:831)     at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:862)     at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:717)     at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)     at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:692)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:573)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:756)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:601)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:459)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:784)     at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:436)     at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:360)     at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)     at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)     at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:272)     at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:245)     at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)     at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:193)     ... 48 more
{code}
Trying 
{code:xml}
<fo:external-graphic height="120mm" width="120mm" src="Test.svg"/>  {code}
the error does not occur, but the output is wrong (SVG is not displayed correctly - this is the case since FOP 0.95, etc.).

We tested with our current FOP 2.3 and also with the latest FOP 2.4; used different SVG files, fiddled with several parameters of instream-foreign-object / svg:svg / svg: image, ....always  same error.

So we end up not being able to use the JDK internal XSLT or Xalan XSLT processor and are stuck with Saxon at this single NullPointerException during FO to IF transaformation. We spend yesterday the whole day (!) search for solutions / workarounds on the web but the only hint we found was something with namespaces or empty URIs.


> NPE during FO 2 IF transformation with instream-foreign-object using Saxon
> --------------------------------------------------------------------------
>
>                 Key: FOP-2914
>                 URL: https://issues.apache.org/jira/browse/FOP-2914
>             Project: FOP
>          Issue Type: Bug
>         Environment: Windows 10, OpenJDK 11.0.2, Fop 2.3 (Fop 2.4)
>            Reporter: M.H.
>            Priority: Major
>
> So far, we used Xalan (2.7.2) as the XSLT Processor to transform our XML/XSL to FO and further to IF (intermediate format) to concat these to one file that is finally rendered to PDF (to avoid multiple fonts via PDF concatenation). We now have a current version of a 3rd party library that breaks our app because of Xalan  (known bug: [https://stackoverflow.com/questions/45152707/transformerfactory-and-xalan-dependency-conflict]) . So we investigated a lot of time, adjusted our XMl APIs, converted to JAXB, removed Xalan and werent able to use the JDK 11 internal XSLT processor because our (hundreds of) XSLTs don't work anymore because they only seem to work with a "lazy" XSLT processor like Xalan. For this reason, we evaluate the Saxon XSLT processor. With *Saxon*, most things work again except one bug:
> We (have to) include SVG files with instream-foreign-object:
> {code:xml}
> <fo:instream-foreign-object>
>   <svg:svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="120mm" height="120mm" >
>     <svg:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Test.svg" width="120mm" height="120mm"/>
>   </svg:svg>
> </fo:instream-foreign-object>
> {code}
> And during the transformation of the FO to Apaches intermediate format IF, a NullPointerException occurs:
> {code:java}
> Error while rendering page 1. Reason: java.lang.NullPointerException     at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:74)     at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:173)     at com.sun.proxy.$Proxy11.pageRenderingError(Unknown Source)     at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:206)     at org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:174)     at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:146)     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:243)     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:287)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.makeNewPage(PageSequenceLayoutManager.java:192)     at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:633)     at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:511)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:659)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:604)     at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:599)     at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:338)     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:458)     at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:143)     at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)     at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)     at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)     at de.icomps.xml.FOP$HandlerXML.endElement(FOP.java:1624)     at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:412)     at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:185)     at net.sf.saxon.event.SequenceNormalizer.endElement(SequenceNormalizer.java:230)     at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:528)     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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)     at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:435)     at net.sf.saxon.event.Sender.send(Sender.java:167)     at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:368)     at de.icomps.xml.FOP.transformFO(FOP.java:1055)     at de.icomps.xml.FOP.fo2IF(FOP.java:789)     at de.icomps.rep.Report.createWithFOP(Report.java:3772)     at de.icomps.rep.Report.processReport(Report.java:2078)     at de.icomps.rep.ReportClient.createClientReport(ReportClient.java:266)     at de.icomps.rep.ReportClientMulti.genClientReportSingle(ReportClientMulti.java:2537)     at de.icomps.rep.ReportClientMulti.genClientReports(ReportClientMulti.java:1804)     at de.icomps.rep.ReportClientMulti.createReport(ReportClientMulti.java:288)     at de.icomps.rep.Report.startProcessing(Report.java:1548)     at de.icomps.ijs.JobTask.startJob(JobTask.java:412)     at de.icomps.ijs.JobTask.run(JobTask.java:154)     at java.base/java.lang.Thread.run(Thread.java:834)    Caused by: java.lang.NullPointerException     at net.sf.saxon.event.ReceivingContentHandler.getNodeName(ReceivingContentHandler.java:485)     at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:398)     at org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:185)     at org.apache.fop.util.DOM2SAX.writeNode(DOM2SAX.java:263)     at org.apache.fop.util.DOM2SAX.writeDocument(DOM2SAX.java:73)     at org.apache.fop.render.intermediate.IFSerializer.drawImage(IFSerializer.java:508)     at org.apache.fop.render.intermediate.IFRenderer.renderForeignObject(IFRenderer.java:1312)     at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:864)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:831)     at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:862)     at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:717)     at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)     at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:692)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:573)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:756)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:601)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)     at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:459)     at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:784)     at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:436)     at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:360)     at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)     at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)     at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:272)     at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:245)     at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)     at org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:193)     ... 48 more
> {code}
> Trying 
> {code:xml}
> <fo:external-graphic height="120mm" width="120mm" src="Test.svg"/>  {code}
> the error does not occur, but the output is wrong (SVG is not displayed correctly - this is the case since FOP 0.95, etc.).
> We tested with our current FOP 2.3 and also with the latest FOP 2.4; used different SVG files, fiddled with several parameters of instream-foreign-object / svg:svg / svg: image, ....always  same error.
> So we end up not being able to use the JDK internal XSLT or Xalan XSLT processor and are stuck with Saxon at this single NullPointerException during FO to IF transaformation. We spend yesterday the whole day (!) search for solutions / workarounds on the web but the only hint we found was something with namespaces or empty URIs.
> We tried to create a reproducable case with "fop.bat" and plain FOP directory (original, without Xalan, without Xalan and with Saxon), same OpenJDK,  create single scripts to transform FO to IF and IF to PDF, but the bug didn't occur! So, it seems it only accours when using the Java API.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)