JDK-8127359 : on Linux installed in headless mode with added X-Server com.sun.t2k.LogicalFont.getDefaultAAMode throws NPE
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2011-12-14
  • Updated: 2015-06-17
  • Resolved: 2012-01-11
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.
Other
fx2.1Fixed
Related Reports
Relates :  
Relates :  
Description
see http://javafx-jira.kenai.com/browse/RT-18489

next applications throws NPE.

import javafx.application.*; 
import javafx.stage.*; 
import javafx.scene.text.*; 
import javafx.scene.*; 

public class dofx extends Application { 
public static void main(String[] args) { launch(); } 

 	public void start(Stage stage) throws Exception { 
stage.setTitle("test"); 
stage.setScene(new Scene(new Group(new Text(25,25,"text")))); 
stage.show(); 
} } 

--------------------------------- 

$ java -cp javafx-sdk2.1.0-beta/rt/lib/jfxrt.jar:. dofx 
Exception in Application start method 
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method 
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:379) 
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:28) 
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:98) 
at java.lang.Thread.run(Thread.java:636) 
Caused by: java.lang.NullPointerException 
at com.sun.t2k.LogicalFont.getDefaultAAMode(LogicalFont.java:300) 
at com.sun.t2k.LogicalFont.getStrike(LogicalFont.java:304) 
at com.sun.t2k.T2KFont.getStrike(T2KFont.java:70) 
at com.sun.javafx.font.PrismFontUtils.getFontMetrics(PrismFontUtils.java:14) 
at com.sun.javafx.font.PrismFontLoader.getFontMetrics(PrismFontLoader.java:434) 
at javafx.scene.text.Text.<init>(Text.java:105) 
at javafx.scene.text.Text.<init>(Text.java:113) 
at javafx.scene.text.Text.<init>(Text.java:125) 
at dofx.start(dofx.java:13) 
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:299) 
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:153) 
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:120) 
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) 
at com.sun.glass.ui.gtk.GtkApplication$1$1.run(GtkApplication.java:36) 
... 1 more 
Comments
There's a stop-gap for this issue, so the exception shouldn't occur now. As this bug in only referring to the exception, I'm closing it as fixed. RT-17179 is for tracking the main issue.
11-01-2012

Might this be related to RT-17179?
14-12-2011

Please try to run it on Sun JDK, as I am unable to reproduce this. Also, can you please assign all linux bugs directly on me and add "linux" label to them? Thanks.
14-12-2011