My fop.jar has a userconfig.xml that defines MSMincho for when I need to render Japanese text. This works fine on Windows systems, but throws a NullPointerException when fop.jar runs from AIX The exception is: java.lang.NullPointerException at org.apache.fop.render.pdf.fonts.LazyFont.getAscender(Unknown Source) at org.apache.fop.layout.FontState.getAscender(Unknown Source) at org.apache.fop.layout.LineArea.(Unknown Source) at org.apache.fop.layout.BlockArea.start(Unknown Source) at org.apache.fop.fo.flow.Block.layout(Unknown Source) at org.apache.fop.fo.flow.TableCell.layout(Unknown Source) at org.apache.fop.fo.flow.TableRow.layout(Unknown Source) at org.apache.fop.fo.flow.TableBody.layout(Unknown Source) at org.apache.fop.fo.flow.Table.layout(Unknown Source) at org.apache.fop.fo.flow.Block.layout(Unknown Source) at org.apache.fop.fo.flow.StaticContent.layout(Unknown Source) at org.apache.fop.fo.pagination.PageSequence.layoutStaticContent (Unknown Source) at org.apache.fop.fo.pagination.PageSequence.formatStaticContent (Unknown Source) at org.apache.fop.fo.pagination.PageSequence.format(Unknown Source) at org.apache.fop.apps.StreamRenderer.render(Unknown Source) at org.apache.fop.fo.FOTreeBuilder.endElement(Unknown Source) at weblogic.apache.xerces.parsers.SAXParser.endElement(SAXParser.java (Compiled Code)) at weblogic.apache.xerces.validators.common.XMLValidator.callEndElement (XMLValidator.java(Compiled Code)) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch (XMLDocumentScanner.java(Compiled Code)) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome (XMLDocumentScanner.java(Compiled Code)) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1119) at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135) at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133) at org.apache.fop.apps.Driver.render(Unknown Source) at com.alphablox.xsl.PdfTransformer.runTask(Unknown Source) at com.alphablox.util.threadpool.WorkerThread.run(Unknown Source) This is also failing with 0.20.5
The problem also exists on windows, if the application runs on a SAP Web Application Server. Here is a part of the stack trace with the line numbers missing in the first report: java.lang.NullPointerException at org.apache.fop.render.pdf.fonts.LazyFont.getAscender(LazyFont.java:127) at org.apache.fop.layout.FontState.getAscender(FontState.java:143) at org.apache.fop.layout.LineArea.<init>(LineArea.java:326) at org.apache.fop.layout.BlockArea.getCurrentLineArea(BlockArea.java:164)
Under 0.20 you need to call: org.apache.fop.configuration.Configuration.put ("fontBaseDir","/absolute/path/to/metrics/directory"); or put this in your configuration file. Otherwise it can't find the files and returns a null pointer error when it (later) tries to access them.
Under 0.20 you need to call: org.apache.fop.configuration.Configuration.put ("fontBaseDir","/absolute/path/to/metrics/directory"); or put this in your configuration file. Otherwise the paths to the metrics and the fonts are relative to the current working directory, and you get this exception when it later tries to open them. (You can also put absolute paths for the files).
resetting severity from major to normal pending further review