Bug 840 - IllegalThreadStateException at DefaultEDTUtil.restart() when re-launch NEWT Applet (JOGLNewtApplet1Run)
Summary: IllegalThreadStateException at DefaultEDTUtil.restart() when re-launch NEWT A...
Status: RESOLVED FIXED
Alias: None
Product: Newt
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: --- enhancement
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-09-22 02:32 CEST by Sven Gothel
Modified: 2013-09-22 02:36 CEST (History)
0 users

See Also:
Type: ---
SCM Refs:
c5bec6b8f5c33a812338dcbe8994546bddf0508b
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2013-09-22 02:32:57 CEST
With jdk7u40, when re-launching a NEWT applet (JOGLNewtApplet1Run),
i.e. via browser back and forth, the following exception happens:

java.lang.RuntimeException: java.lang.IllegalThreadStateException
    at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.init(JOGLNewtApplet1Run.java:218)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalThreadStateException
    at java.lang.ThreadGroup.addUnstarted(Unknown Source)
    at java.lang.Thread.init(Unknown Source)
    at java.lang.Thread.<init>(Unknown Source)
    at jogamp.newt.DefaultEDTUtil$NEDT.<init>(DefaultEDTUtil.java:280)
    at jogamp.newt.DefaultEDTUtil.restart(DefaultEDTUtil.java:91)
    at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:231)
    at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1758)
    at jogamp.newt.WindowImpl.setUndecorated(WindowImpl.java:1477)
    at com.jogamp.newt.opengl.GLWindow.setUndecorated(GLWindow.java:278)
    at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.init(JOGLNewtApplet1Run.java:188)
    ... 3 more

This is due to 7u40's changed ThreadGroup (tg) lifecycle, i.e. the tg is destroyed.
In such case, DefaultEDTUtil.restart() shall use the current threads tg.