JDK-8152387 : IllegalAccessError when running some closed toys
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-03-22
  • Updated: 2017-05-11
  • Resolved: 2016-09-10
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
Blocks :  
Description
Following exception was thrown during the toys(run-controls.sh) testing.

Exception in Application start method
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:531)
 at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(javafx.graphics@9-ea/LauncherImpl.java:392)
 at com.sun.javafx.application.LauncherImpl.launchApplication(javafx.graphics@9-ea/LauncherImpl.java:331)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:531)
 at sun.launcher.LauncherHelper$FXHelper.main(java.base@9-ea/LauncherHelper.java:866)
Caused by: java.lang.RuntimeException: Exception in Application start method
 at com.sun.javafx.application.LauncherImpl.launchApplication1(javafx.graphics@9-ea/LauncherImpl.java:896)
 at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(javafx.graphics@9-ea/LauncherImpl.java:187)
 at java.lang.Thread.run(java.base@9-ea/Thread.java:804)
Caused by: java.lang.IllegalAccessError: class hellotest.HelloHighContrast (in unnamed module @0x5350cb5f) cannot access class com.sun.javafx.application.PlatformImpl (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.application to unnamed module @0x5350cb5f
 at hellotest.HelloHighContrast.lambda$start$0(HelloHighContrast.java:53)
 at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(javafx.base@9-ea/ExpressionHelper.java:348)
 at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(javafx.base@9-ea/ExpressionHelper.java:80)
 at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(javafx.base@9-ea/ReadOnlyObjectPropertyBase.java:74)
 at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(javafx.base@9-ea/ReadOnlyObjectWrapper.java:102)
 at javafx.beans.property.ObjectPropertyBase.markInvalid(javafx.base@9-ea/ObjectPropertyBase.java:113)
 at javafx.beans.property.ObjectPropertyBase.set(javafx.base@9-ea/ObjectPropertyBase.java:147)
 at javafx.scene.control.ToggleGroup$3.set(javafx.controls@9-ea/ToggleGroup.java:137)
 at javafx.scene.control.ToggleGroup$3.set(javafx.controls@9-ea/ToggleGroup.java:119)
 at javafx.scene.control.ToggleGroup.selectToggle(javafx.controls@9-ea/ToggleGroup.java:149)
 at javafx.scene.control.ToggleButton$1.invalidated(javafx.controls@9-ea/ToggleButton.java:168)
 at javafx.beans.property.BooleanPropertyBase.markInvalid(javafx.base@9-ea/BooleanPropertyBase.java:110)
 at javafx.beans.property.BooleanPropertyBase.set(javafx.base@9-ea/BooleanPropertyBase.java:145)
 at javafx.scene.control.ToggleButton.setSelected(javafx.controls@9-ea/ToggleButton.java:149)
 at hellotest.HelloHighContrast.start(HelloHighContrast.java:60)
 at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(javafx.graphics@9-ea/LauncherImpl.java:842)
 at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(javafx.graphics@9-ea/PlatformImpl.java:346)
 at com.sun.javafx.application.PlatformImpl.lambda$runLater$5(javafx.graphics@9-ea/PlatformImpl.java:315)
 at java.security.AccessController.doPrivileged(java.base@9-ea/Native Method)
 at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(javafx.graphics@9-ea/PlatformImpl.java:314)
 at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(javafx.graphics@9-ea/InvokeLaterDispatcher.java:96)
 at com.sun.glass.ui.gtk.GtkApplication._runLoop(javafx.graphics@9-ea/Native Method)
 at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$5(javafx.graphics@9-ea/GtkApplication.java:139)
 ... 1 more
Exception running application hellotest.HelloHighContrast
Comments
+1
10-09-2016

I'll fix this after JDK-8163316 is fixed.
26-08-2016

The test program in question is using internal packages. Since it is intended as a test program and not as a sample or demo, the fix will be to change the run-* scripts that reference it to add the needed qualified exports. We also get an illegal access error from the following: hellotest.HelloFPS: Caused by: java.lang.IllegalAccessError: class hellotest.HelloFPS (in unnamed module @0x7f9da0f6) cannot access class com.sun.javafx.perf.PerformanceTracker (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.perf to unnamed module @0x7f9da0f6 helloworld.HelloTreeView Caused by: java.lang.IllegalAccessError: class helloworld.HelloTreeView (in unnamed module @0x3f0dadfe) cannot access class com.sun.javafx.PlatformUtil (in module javafx.base) because module javafx.base does not export com.sun.javafx to unnamed module @0x3f0dadfe
26-08-2016