JDK-8120656 : NPE in glass using J2DPipeline
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 7u6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-06-13
  • Updated: 2015-06-17
  • Resolved: 2012-06-28
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
Duplicate :  
Relates :  
Relates :  
Description
Run whatever fx snippet using the j2d pipeline on the mac.
Personally I use: -Dprism.debugfonts=true -Dprism.verbose=true -Dprism.order=j2d

I get a NPE everytime I resize the window, after that the windows no longer draws.

Here is my output:

Prism pipeline init order: j2d 
Using t2k for text rasterization
Using dirty region optimizations
Prism pipeline name = com.sun.prism.j2d.J2DPipeline
*** Fallback to Prism SW pipeline
(X) Got class = class com.sun.prism.j2d.J2DPipeline
Initialized prism pipeline: com.sun.prism.j2d.J2DPipeline
RESIZE: 1339559033699184000 w: 300 h: 300
Glass native format: 1
2012-06-12 20:43:53.787 java[25149:707] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.
RESIZE: 1339559043441099000 w: 291 h: 288
Glass native format: 1
RESIZE: 1339559043488702000 w: 283 h: 278
Glass native format: 1
RESIZE: 1339559043496663000 w: 280 h: 275
Glass native format: 1
RESIZE: 1339559043538820000 w: 277 h: 271
Glass native format: 1
Glass detected outstanding Java exception at -[GlassRunnable run]:src/com/sun/mat/ui/GlassApplication.m:78
Exception in thread "AWT-AppKit" java.lang.NullPointerException
	at com.sun.glass.ui.mac.MacView._uploadPixels(MacView.java:70)
	at com.sun.glass.ui.View.uploadPixels(View.java:758)
	at com.sun.prism.j2d.J2DPresentable$Glass$1.run(J2DPresentable.java:99)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
RESIZE: 1339559043546210000 w: 276 h: 270
Glass native format: 1
RESIZE: 1339559043573615000 w: 275 h: 270
Glass native format: 1

Comments
Pushed fix into graphics rt-closed changeset: 16327:c377b02113bc date: Thu Jun 28 16:05:32 2012 -0700 Targeted for 2.2 build16
28-06-2012

SQE: OK
28-06-2012

This looks like the same issue as the earlier-reported RT-21402 so one of them should be closed as a duplicate of the other.
23-06-2012

Will take a look for 2.2, but given that J2D pipeline on Mac is a low priority we may push this to Lombard.
13-06-2012

Apparently the pixels object passed to Glass' View.uploadPixels() is null. This is a bug in J2D pipeline. The pixels object should never be null. Reassigning to Graphics.
13-06-2012

I see the NPE with a test case as simple as this public void start(Stage stage) throws Exception { VBox box = new VBox(); String string = "Hi<e\u0301>"; Font font = new Font("System", 36); Text node = new Text(string); node.setFont(font); box.getChildren().add(node); Scene scene = new Scene(box, 300, 300, Color.YELLOW); stage.setTitle("My JavaFX Application"); stage.setScene(scene); stage.show(); }
13-06-2012