Bug 21982

Summary: NullPointer Exception in LazyFont with embedded fonts (japanese fonts) in AIX
Product: Fop - Now in Jira Reporter: Julio <jsantos>
Component: pdfAssignee: fop-dev
Status: NEW ---    
Severity: normal CC: daisuke.okuda, mksjoshi
Priority: P3    
Version: 0.20.4   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Julio 2003-07-30 00:57:07 UTC
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
Comment 1 Frank Dohrmann 2005-07-20 17:13:40 UTC
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)





Comment 2 Ken Blackler 2005-09-20 13:03:14 UTC
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.
Comment 3 Ken Blackler 2005-09-20 13:07:19 UTC
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).
Comment 4 Glenn Adams 2012-04-07 01:37:09 UTC
resetting severity from major to normal pending further review