JDK-8139450 : JavaFX applications cannot be run with JDK 9-b85 promoted build
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 9
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-12
  • Updated: 2015-10-14
  • Resolved: 2015-10-12
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 9
9Fixed
Related Reports
Relates :  
Relates :  
Description
Ensemble8 cannot be run with latest JDK/JFX9 promoted builds.
The following exception happens:
Exception in Application start method
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:520)
	at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:392)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:331)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:520)
	at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:771)
Caused by: java.lang.RuntimeException: Exception in Application start method
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:920)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:187)
	at java.lang.Thread.run(Thread.java:747)
Caused by: java.lang.NoClassDefFoundError: sun/misc/SharedSecrets
	at com.sun.javafx.tk.quantum.GlassStage.<clinit>(GlassStage.java:49)
	at com.sun.javafx.tk.quantum.QuantumToolkit.createTKStage(QuantumToolkit.java:548)
	at javafx.stage.Stage.impl_visibleChanging(Stage.java:1164)
	at javafx.stage.Window$9.invalidated(Window.java:824)
	at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
	at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
	at javafx.stage.Window.setShowing(Window.java:922)
	at javafx.stage.Window.show(Window.java:937)
	at javafx.stage.Stage.show(Stage.java:259)
	at ensemble.EnsembleApp.start(EnsembleApp.java:354)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:866)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Caused by: java.lang.ClassNotFoundException: sun.misc.SharedSecrets
	at java.net.URLClassLoader.findClass(URLClassLoader.java:384)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 16 more
Exception running application ensemble.EnsembleApp

Reproducible with JDK/JFX9 b85.
Comments
This fix will be pushed to 9 master in time for 9-b86.
12-10-2015

http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/f423d490ae1b
12-10-2015

Thanks for the review. I will fix the following typo in the comment before I push: - // Need to access via refelction since the SharedSecrets class moved to + // Need to access via reflection since the SharedSecrets class moved to
12-10-2015

Tested with JDK 9-b85 + FX 9-dev including this patch. It is DOA before the change and works after the change. Also verified that pre-9-b85 still works with the fallback to the old package name.
12-10-2015

Fix looks good, +1
12-10-2015

http://cr.openjdk.java.net/~kcr/8139450/webrev.00/ The fix is to use reflection to access the two classes in question, first in their new location (jdk.misc.internal) and failing that, in their old location (sun.misc).
12-10-2015

I can reproduce this bug, and can further confirm that this affects all JavaFX application. JavaFX is completely DOA in 9-b85.
12-10-2015