When we launch appetviewer with -debug option, some confusing message
shows up.
Configration:
OS: Solaris/Windows
JDK:
- 1.4.1_01 (on Solaris)
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
- 1.4.2-beta(on Windows2000)
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b12)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b12, mixed mode)
Reproduction:
1) Compile the attached test program.
==== test.java ===
/*
<applet code="test.class" width=200 height=200></applet>
*/
public class test extends javax.swing.JApplet{
public test(){
}
}
==================
2) Invoke
"appletviewer -debug test.java"
You will enter into debug mode and see prompt ">"
3) Type "run"
You will see the appletwindow.
4) Select "quit" in "file" menu of appletwindow
you will see the message,
Exception occurred: java.lang.ThreadDeath (uncaught)"thread=TimerQueue", javax.s
wing.TimerQueue.run(), line=246 bci=66
This message confuse appletusers.
Question:
1) According to java documentation 1.4.1, stop() in Thread class will be
deprecated. Why is the stop() still used ?
2) Is it the specifications that jdb(JPDA debugger) outputs ThreadDeath
message ?
According to documentation in java.lang.Thread#stop, application
should not catch the instance of ThreadDeath.
However, debugger seems to do it.
"An application should not normally try to catch ThreadDeath unless it must
do some extraordinary cleanup operation (note that the throwing of ThreadDeath
causes finally clauses of try statements to be executed before the thread
officially dies). If a catch clause catches a ThreadDeath object, it is
important to rethrow the object so that the thread actually dies.
The top-level error handler that reacts to otherwise uncaught exceptions
does not print out a message or otherwise notify the application if the
uncaught exception is an instance of ThreadDeath. "
Note:
-The message does not appear without -debug option.
===============================================================================
shows up.
Configration:
OS: Solaris/Windows
JDK:
- 1.4.1_01 (on Solaris)
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
- 1.4.2-beta(on Windows2000)
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b12)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b12, mixed mode)
Reproduction:
1) Compile the attached test program.
==== test.java ===
/*
<applet code="test.class" width=200 height=200></applet>
*/
public class test extends javax.swing.JApplet{
public test(){
}
}
==================
2) Invoke
"appletviewer -debug test.java"
You will enter into debug mode and see prompt ">"
3) Type "run"
You will see the appletwindow.
4) Select "quit" in "file" menu of appletwindow
you will see the message,
Exception occurred: java.lang.ThreadDeath (uncaught)"thread=TimerQueue", javax.s
wing.TimerQueue.run(), line=246 bci=66
This message confuse appletusers.
Question:
1) According to java documentation 1.4.1, stop() in Thread class will be
deprecated. Why is the stop() still used ?
2) Is it the specifications that jdb(JPDA debugger) outputs ThreadDeath
message ?
According to documentation in java.lang.Thread#stop, application
should not catch the instance of ThreadDeath.
However, debugger seems to do it.
"An application should not normally try to catch ThreadDeath unless it must
do some extraordinary cleanup operation (note that the throwing of ThreadDeath
causes finally clauses of try statements to be executed before the thread
officially dies). If a catch clause catches a ThreadDeath object, it is
important to rethrow the object so that the thread actually dies.
The top-level error handler that reacts to otherwise uncaught exceptions
does not print out a message or otherwise notify the application if the
uncaught exception is an instance of ThreadDeath. "
Note:
-The message does not appear without -debug option.
===============================================================================
- duplicates
-
JDK-4516090 JDB reports thread death in the JAVA IDL Reader Thread
- Resolved