Image

Imagestipe wrote in Imagejava_dev

ThreadDeath

One of the guys on my team (okay, the one other guy on my team) is working on the client portion of our project, which is implemented as a Java Applet. He's running into a problem where he occasionally gets a ThreadDeath when the applet is starting up, and then Java locks up the browser entirely, forcing you to kill the process (this is using Firefox 0.8 on Windows XP, Java Plugin 1.4.2). My exposure to applets is (somewhat intentionally) slim, so I was hoping someone here might have some idea about this.



Here's the one stack trace that we've managed to get. I've left out some of the details as the best we could get was a screen capture (since the java console was frozen), so I'm typing this in by hand.

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.NewInstance0(NativeMethod)
    at sun.reflect.NativeConstructorAccessorImpl.NewInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at a bunch of our code that's supposed to be creating instances of classes
Caused by: java.lang.ThreadDeath
    at java.lang.Thread.stop(Thread.java:630)
    at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:633)
    at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:643)
    at java.lang.ThreadGroup.stop(ThreadGroup.java:547)
    at sun.awt.AppContext.dispose(AppContext.java:411)
    at sun.applet.AppletClassLoader.release(AppletClassLoader.java:668)
    at sun.plugin.security.PluginClassLoader.release(Unknown Source)
    at sun.applet.AppletPanel.release(AppletPanel.java:168)
    at sun.applet.AppletPanel.sendEvent(AppletPanel.java:265)
    at sun.plugin.AppletViewer.onPrivateClose(Unknown Source)
    at sun.plugin.AppletViewer$1.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:534)


Any ideas what could be causing that? It also seems to happen on occasion when the applet tries to load image resources out of a jar file as well. It only happens on occasion, which made us think we had some sort of race condition of our own making, but we've now got everything down to one thread (at least at the point of the freeze), which makes that pretty unlikely.

It's also entirely possible that the freeze has nothing to do with the above exception (after all, corellation != causation), but I thought I'd ask around.