My applet is getting unexpectedly terminated. From log, I could see
JVM heartbeat .. dead, send ts: 654648165466, now ts: 654658163729, dT 9998263
I had a shutdown hook to see who is killing the applet & I got the following
stack Trace ………Thread[Java Plug-In Heartbeat Thread,5,main]
java.lang.Object.wait(Native Method)
java.lang.Thread.join(Unknown Source)
java.lang.Thread.join(Unknown Source)
java.lang.ApplicationShutdownHooks.runHooks(Unknown Source)
java.lang.ApplicationShutdownHooks$1.run(Unknown Source)
java.lang.Shutdown.runHooks(Unknown Source)
java.lang.Shutdown.sequence(Unknown Source)
java.lang.Shutdown.exit(Unknown Source)
java.lang.Runtime.exit(Unknown Source)
java.lang.System.exit(Unknown Source)
sun.plugin2.main.client.PluginMain.exit(Unknown Source)
sun.plugin2.main.client.PluginMain.access$1300(Unknown Source)
sun.plugin2.main.client.PluginMain$HeartbeatThread.run(Unknown Source)
I don’t understand why heartbeat Thread is working here. I don’t have multiple jvms & it is single applet without any socket communication. Only data transfer to server is through http
from the source code of PluginMain, it looks like we can prevent the HeartBeatThread from starting by setting an environment variable JPI_PLUGIN2_NO_HEARTBEAT to some value
http://www.javasourcecode.org/html/open-source/jdk/jdk-6u23/sun/plugin2/main/client/PluginMain.java.html