JDK-8128161 : NullPointerException at getFontResourceByFileName(T2KFontFactory.java:485)
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2011-10-18
  • Updated: 2015-06-17
  • Resolved: 2012-05-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u6Fixed
Related Reports
Blocks :  
Duplicate :  
Description
error where found some font file

java.lang.NullPointerException
	at com.sun.t2k.T2KFontFactory.getFontResourceByFileName(T2KFontFactory.java:485)
	at com.sun.t2k.T2KFontFactory.getFontResource(T2KFontFactory.java:423)
	at com.sun.t2k.FallbackResource.getSlotResource(FallbackResource.java:168)
	at com.sun.t2k.T2KCompositeFontResource.getSlotResource(T2KCompositeFontResource.java:50)
	at com.sun.t2k.CompositeGlyphMapper.getSlotMapper(CompositeGlyphMapper.java:52)
	at com.sun.t2k.CompositeGlyphMapper.convertToGlyph(CompositeGlyphMapper.java:73)
	at com.sun.t2k.CompositeGlyphMapper.getGlyphCode(CompositeGlyphMapper.java:129)
	at com.sun.t2k.CharToGlyphMapper.charToGlyph(CharToGlyphMapper.java:116)
	at com.sun.t2k.CompositeStrike.getCharAdvance(CompositeStrike.java:183)
	at com.sun.webpane.sg.prism.WCFontImpl.getGlyphWidth(WCFontImpl.java:140)
	at com.sun.webpane.platform.WebPage.twkUpdateContent(Native Method)
	at com.sun.webpane.platform.WebPage.updateDirty(WebPage.java:366)
	at com.sun.webpane.platform.WebPage.updateContent(WebPage.java:632)
	at com.sun.javafx.sg.prism.NGWebView.update(NGWebView.java:52)
	at javafx.scene.web.WebView.handleStagePulse(WebView.java:562)
	at javafx.scene.web.WebView.access$100(WebView.java:55)
	at javafx.scene.web.WebView$2.pulse(WebView.java:165)
	at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:289)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:398)
	at com.sun.javafx.tk.quantum.QuantumToolkit$10.run(QuantumToolkit.java:330)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
	at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
	at java.lang.Thread.run(Unknown Source)
Comments
Unit Tests: It can't reproduce in most cases. To verify the fix you need to have a particular font file, whose name can't be find in its font file, to go through the default font name setting. By that, we can verify the font file initialization is safe now. This makes writing unit test impossible.
22-05-2012

When running the following code, same exception occurs. WebView view = new WebView(); WebEngine engine = view.getEngine(); engine.loadContent("<html><body><p>(�����������������)</p></body></html>"); Exception is below: java.lang.NullPointerException at com.sun.t2k.T2KFontFactory.getFontResourceByFileName(T2KFontFactory.java:485) at com.sun.t2k.T2KFontFactory.getFontResource(T2KFontFactory.java:423) at com.sun.t2k.LogicalFont.getSlotResource(LogicalFont.java:216) at com.sun.t2k.CompositeGlyphMapper.getSlotMapper(CompositeGlyphMapper.java:52) at com.sun.t2k.CompositeGlyphMapper.convertToGlyph(CompositeGlyphMapper.java:73) at com.sun.t2k.CompositeGlyphMapper.getGlyphCode(CompositeGlyphMapper.java:129) at com.sun.t2k.CharToGlyphMapper.charToGlyph(CharToGlyphMapper.java:116) at com.sun.t2k.CompositeStrike.getCharAdvance(CompositeStrike.java:183) at com.sun.t2k.CompositeStrike.getStringWidth(CompositeStrike.java:239) at com.sun.webpane.sg.prism.WCFontImpl.getStringLength(WCFontImpl.java:202) at com.sun.webpane.webkit.Timer.twkFireTimerEvent(Native Method) at com.sun.webpane.webkit.Timer.fireTimerEvent(Timer.java:66) at com.sun.webpane.webkit.Timer.notifyTick(Timer.java:47) at javafx.scene.web.WebEngine$PulseTimer$2.pulse(WebEngine.java:568) at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:292) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:398) at com.sun.javafx.tk.quantum.QuantumToolkit$10.run(QuantumToolkit.java:330) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29) at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62) at java.lang.Thread.run(Thread.java:722)
21-11-2011