Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.4K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187.1K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 443 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
JavaFX could not create platform window

Hi,
we have a JAvaFX application running. Sometimes the application crashes with the following exception.
It's OpenJDK 11 with OpenFX14 running on Windows 10 machines.
Any idea what can cause this problem
java.lang.RuntimeException: could not create platform window
at javafx.graphics/com.sun.glass.ui.Window.<init>(Window.java:294)
at javafx.graphics/com.sun.glass.ui.win.WinWindow.<init>(WinWindow.java:54)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.createWindow(WinApplication.java:219)
at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.initPlatformWindow(WindowStage.java:201)
at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.init(WindowStage.java:143)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.createTKPopupStage(QuantumToolkit.java:678)
at javafx.graphics/javafx.stage.PopupWindow.doVisibleChanging(PopupWindow.java:514)
at javafx.graphics/javafx.stage.PopupWindow$1.doVisibleChanging(PopupWindow.java:107)
at javafx.graphics/com.sun.javafx.stage.PopupWindowHelper.visibleChangingImpl(PopupWindowHelper.java:57)
at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanging(WindowHelper.java:73)
at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1064)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1174)
at javafx.graphics/javafx.stage.Window.show(Window.java:1189)
at javafx.graphics/javafx.stage.PopupWindow.showImpl(PopupWindow.java:472)
at javafx.graphics/javafx.stage.PopupWindow.show(PopupWindow.java:437)
at javafx.controls/javafx.scene.control.Tooltip$TooltipBehavior.lambda$new$0(Tooltip.java:899)
at javafx.graphics/javafx.animation.Animation.finished(Animation.java:1131)
at javafx.graphics/javafx.animation.AnimationAccessorImpl.finished(AnimationAccessorImpl.java:49)
at javafx.graphics/com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(SingleLoopClipEnvelope.java:101)
at javafx.graphics/javafx.animation.Animation.doTimePulse(Animation.java:1101)
at javafx.graphics/javafx.animation.Animation$1.lambda$timePulse$0(Animation.java:186)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/javafx.animation.Animation$1.timePulse(Animation.java:185)
at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:344)
at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:559)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:543)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:536)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:342)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Answers
-
Yes.
I have discovered the same problem in java 16 and all the way back to java 11.
If I run the following code:
package test;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Popup;
import javafx.stage.Stage;
public class TestFX extends Application {
@Override
public void start(Stage primaryStage) {
System.out.println("javafx.runtime.version: " + System.getProperties().get("javafx.runtime.version"));
Stage stage = new Stage();
Scene scene = new Scene(new StackPane());
stage.setScene(scene);
stage.show();
Popup popOver = new Popup();
for (int i = 0; i < 99999; i++) {
popOver.show(scene.getRoot(), 1, 1);
popOver.hide();
System.out.println(i);
}
}
public static void main(String[] args) {
launch(args);
}
}
It will crash with after some iterations, it can vary.
the error stacktrace:
Exception in Application start method
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.base/com.sun.javafx.binding.ExpressionHelper.removeListener(ExpressionHelper.java:73)
at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.removeListener(ReadOnlyBooleanPropertyBase.java:67)
at javafx.graphics/javafx.stage.PopupWindow.unbindOwnerFocusedProperty(PopupWindow.java:895)
at javafx.graphics/javafx.stage.PopupWindow.doVisibleChanged(PopupWindow.java:542)
at javafx.graphics/javafx.stage.PopupWindow$1.doVisibleChanged(PopupWindow.java:111)
at javafx.graphics/com.sun.javafx.stage.PopupWindowHelper.visibleChangedImpl(PopupWindowHelper.java:63)
at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanged(WindowHelper.java:77)
at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1160)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1187)
at javafx.graphics/javafx.stage.Window.hide(Window.java:1212)
at javafx.graphics/javafx.stage.PopupWindow.hide(PopupWindow.java:486)
at javafx.graphics/javafx.stage.PopupWindow.lambda$new$0(PopupWindow.java:147)
at javafx.base/javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:86)
at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.graphics/javafx.scene.Node$TreeShowingPropertyReadOnly.invalidate(Node.java:8479)
at javafx.graphics/javafx.scene.Node.setTreeShowing(Node.java:8436)
at javafx.graphics/javafx.scene.Node.updateTreeShowing(Node.java:8427)
at javafx.graphics/javafx.scene.Node.lambda$new$2(Node.java:1010)
at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:78)
at javafx.base/javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:103)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1187)
at javafx.graphics/javafx.stage.Window.hide(Window.java:1212)
at javafx.graphics/com.sun.javafx.stage.WindowPeerListener.closed(WindowPeerListener.java:105)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:144)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:40)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.lambda$handleWindowEvent$4(GlassWindowEventHandler.java:176)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:174)
at javafx.graphics/com.sun.glass.ui.Window.handleWindowEvent(Window.java:1336)
at javafx.graphics/com.sun.glass.ui.Window.notifyDestroy(Window.java:1250)
at javafx.graphics/com.sun.glass.ui.win.WinWindow._close(Native Method)
at javafx.graphics/com.sun.glass.ui.Window.close(Window.java:352)
at javafx.graphics/com.sun.glass.ui.win.WinWindow.close(WinWindow.java:316)
at javafx.graphics/com.sun.glass.ui.Application.terminate(Application.java:394)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$exit$13(QuantumToolkit.java:831)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithRenderLock(QuantumToolkit.java:430)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.exit(QuantumToolkit.java:827)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$tkExit$16(PlatformImpl.java:614)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:474)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:447)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:446)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:831)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.lang.RuntimeException: could not create platform window
at javafx.graphics/com.sun.glass.ui.Window.<init>(Window.java:294)
at javafx.graphics/com.sun.glass.ui.win.WinWindow.<init>(WinWindow.java:54)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.createWindow(WinApplication.java:219)
at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.initPlatformWindow(WindowStage.java:201)
at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.init(WindowStage.java:143)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.createTKPopupStage(QuantumToolkit.java:678)
at javafx.graphics/javafx.stage.PopupWindow.doVisibleChanging(PopupWindow.java:514)
at javafx.graphics/javafx.stage.PopupWindow$1.doVisibleChanging(PopupWindow.java:107)
at javafx.graphics/com.sun.javafx.stage.PopupWindowHelper.visibleChangingImpl(PopupWindowHelper.java:57)
at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanging(WindowHelper.java:73)
at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1065)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1187)
at javafx.graphics/javafx.stage.Window.show(Window.java:1202)
at javafx.graphics/javafx.stage.PopupWindow.showImpl(PopupWindow.java:472)
at javafx.graphics/javafx.stage.PopupWindow.show(PopupWindow.java:417)
at test.TestFX.start(TestFX.java:35)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:474)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:447)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:446)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
Exception running application test.TestFX
I see this as a critical error because our customers experiences that popups doesn't show..