You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Hauke Haastert (JIRA)" <ji...@apache.org> on 2014/04/01 09:56:22 UTC

[jira] [Updated] (FOP-2362) Rendering AFP extension to intermediate format throws NullPointerException

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

Hauke Haastert updated FOP-2362:
--------------------------------

    Attachment: extensions.diff
                test.fo
                simple.xsl

> Rendering AFP extension to intermediate format throws NullPointerException
> --------------------------------------------------------------------------
>
>                 Key: FOP-2362
>                 URL: https://issues.apache.org/jira/browse/FOP-2362
>             Project: Fop
>          Issue Type: Bug
>          Components: general
>    Affects Versions: 1.1
>         Environment: Apple OSX 10.9.2 / Java version 1.7.0_11
>            Reporter: Hauke Haastert
>         Attachments: extensions.diff, simple.xsl, test.fo
>
>
> When rendering an XSL-FO file that contains an AFP-Extension to the intermediate format while using Saxon as XSLT transformer, a NullPointerException is thrown.
> Steps to reproduce:
> 1. Download and unpack the FOP 1.1 binary release.
> 2. Change into the root directory "fop-1.1" of the release
> 3. Download Saxon HE from http://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/9.4/Saxon-HE-9.4.jar and copy the file to the lib directory of the FOP 1.1 release
> 4. Edit the file fop that is located in the root directory of the release and add the following JVM parameter to the java_exec_args:
>     -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
>     The line should now look like:
>     java_exec_args="-Djava.awt.headless=true -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl"
> 5. Download the attached files test.fo and simple.xsl and run the following fop command:
>     fop -fo test.fo -out application/X-fop-intermediate-format test.if.xml
> Actual Results:
> Application throws NullPointerException:
> java.lang.NullPointerException
>     at net.sf.saxon.event.ReceivingContentHandler.getNodeName(ReceivingContentHandler.java:391)
>     at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:316)
>     at org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:185)
>     at org.apache.fop.render.afp.extensions.AFPPageSetup.toSAX(AFPPageSetup.java:125)
>     at org.apache.fop.render.intermediate.IFSerializer.handleExtensionObject(IFSerializer.java:680)
> Expected Results:
>     Application should render IF from FO
> Additional Information:
> In the toSAX method of the class org.apache.fop.render.afp.extensions.AFPPageSetup the method addAttribute of the class org.xml.sax.helpers.AttributesImpl is called with null as first argument. Due to the APIDOC of the class org.xml.sax.helpers.AttributesImpl the first argument must either be the namespace or an empty string, but not null:
>     uri - The Namespace URI, or the empty string if none is available or Namespace processing is not being performed.
> When changing the parameter value to an empty string, no NullPointerException is thrown anymore. The same problem exists in other classes in the package org.apache.fop.render.afp.extensions, so I added a diff file for the complete package (extensions.diff).
> The exception is not thrown when using Xalan as XSL transformer. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)