I have a fairly simple applet that does use some fairly complex,
multi-threaded code. The problem is that when the page where the
applet resides is reloaded, it sometimes hangs the entire browser.
I've tracked this down to the point of knowing that a ThreadDeath
Error is being thrown. Here is the stack trace:
java.lang.ThreadDeath
at java.lang.Thread.stop(Thread.java:716)
at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:671)
at java.lang.ThreadGroup.stopOrSuspend
(ThreadGroup.java:681)
at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:681)
at java.lang.ThreadGroup.stop(ThreadGroup.java:584)
at sun.awt.AppContext.dispose(AppContext.java:420)
at sun.applet.AppletClassLoader.release(AppletClassLoader.java:711)
at sun.plugin.security.PluginClassLoader.release
(PluginClassLoader.java:438)
at sun.applet.AppletPanel.release(AppletPanel.java
:175)
at sun.applet.AppletPanel.sendEvent(AppletPanel.java:273)
at sun.plugin.AppletViewer.onPrivateClose(AppletViewer.java:850)
at sun.plugin.AppletViewer$2.run(AppletViewer.java:812)
at java.lang.Thread.run(Thread.java:613)
I have a couple questions:
1. Given that Sun deprecated Thread.stop() ages ago, why are Sun
themselves calling the stop method?
2. According to the debugging I've been able to do, this ThreadDeath
error is being thrown ON A NEWLY CREATED thread AFTER the applet has
already completely reloaded and is actually running. This whole
process of shutting down the applet and then reloading it takes less
than two seconds. I'm just reloading the page. The breakdown is: The
applet is stopped via stop(), then destroyed via destroy(). My
threads are shut down. The page reloads, and the applet reloads,
running its init() and start() methods. The applet starts running and
then *boom*, maybe 20% of the time it gets a ThreadDeath error. This
makes no sense to me. The threads from the previous incarnation of
the applet HAVE been cleaned up and have gone away. So why does JVM
send this ThreadDeath Error? And why send it to my newly created
thread which was running along perfectly fine?
Catching and discarding the ThreadDeath error is not an option.
You're not supposed to do that, and besides, I tried and it doesn't
help.
Any thoughts? Thanks.
Rob
_______________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.