JDK-7086486 : ClassCastException in UIToolkitImpl.changeMode() when running JNLP applet-desc with javaws
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 7-client
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-09-02
  • Updated: 2013-09-12
  • Resolved: 2011-09-06
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 JDK 8
7u2 b04Fixed 8Fixed
Description
Run 
    javaws http://javaweb/~nn136682/JVMArgumentTest/system_property.jnlp

Will sometime get this error in trace and applet does not show.

ui: Attempt to switch toolkit mode after initialization to mode: 1
java.lang.ClassCastException: com.sun.deploy.uitoolkit.impl.awt.AWTPluginUIToolkit cannot be cast to com.sun.deploy.uitoolkit.impl.awt.UIToolkitImpl
    at com.sun.deploy.uitoolkit.impl.awt.UIToolkitImpl.changeMode(UIToolkitImpl.java:152)
    at com.sun.deploy.uitoolkit.ToolkitStore.setMode(ToolkitStore.java:271)
    at sun.plugin2.applet.viewer.JNLP2Viewer.main(JNLP2Viewer.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.javaws.Launcher$2.run(Launcher.java:2117)
    at java.lang.Thread.run(Thread.java:722)

This exception is catched and ignore, however the applet was not showing.