使用 JRE 1.6.0.29 或 1.7.0.1 的 Win 7 64 上的 Chrome 上的 Java 小程序死锁

标签 java applet

我正在编写一个小程序,在 Windows 7 64 上的 Chrome (14.0.835.202 m) 下运行时,它有时甚至在进入 init() 之前就挂起。

我正在使用以下代码来创建小程序(在 元素中创建),并且在 FF 下(甚至在 XP 32 位上运行时的 Chrome)它运行良好:

<script type="text/javascript">
var attributes = {
    id: 'JavaUploader',
    code: 'com.foo.Uploader.class',
    archive: '/java/uploader_0.0.4.jar',
    width: 1,
    height: 1,
};
var parameters = {};
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>

当它挂起时,在获取 JAR 文件之前尝试获取 cookie 时似乎会死锁。这是日志(包括堆栈转储):

Java Plug-in 10.1.0.8
Using JRE version 1.7.0_01-b08 Java HotSpot(TM) Client VM

<snip>

security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
preloader: Construct preloader delegate
preloader: Setting default preloader and progress monitor for non JNLP applets
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@942eb
preloader: Installing progress monitor true
preloader: Using preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@1283826
preloader: Using default preloader
preloader: Requested to use preloader class: null
basic: Plugin2ClassLoader.addURL parent called for http://foo.com/java/uploader_0.0.4.jar
preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame[frame0,0,0,1x1,layout=java.awt.BorderLayout,title=,resizable,normal]
preloader: Added pending event 1: AppletInitEvent[type=CallConstructor]
preloader: Delivering: AppletInitEvent[type=CallConstructor]
preloader: Skipped all (0) download events prior to null
preloader: Start progressCheck thread
security: Blacklist revocation check is enabled
security: Trusted libraries list check is enabled
network: Cache entry found [url: http://foo.com/java/uploader_0.0.4.jar, version: null] prevalidated=false/0
preloader: Stop progressCheck thread

<it stops here>

Dump thread stack ...
----------------------------------------------------
2011-10-25 16:50:26
Full thread dump Java HotSpot(TM) Client VM (21.1-b02 mixed mode, sharing):

"Thread-12" daemon prio=4 tid=0x05478400 nid=0x1b58 waiting on condition [0x095ef000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
   at java.lang.Thread.sleep(Native Method)
   at com.sun.deploy.uitoolkit.impl.awt.AWTAnimationPanel2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

"D3D Screen Updater" daemon prio=8 tid=0x05477c00 nid=0x1554 in Object.wait() [0x08a2f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x2982e5e8> (a java.lang.Object)
   at sun.java2d.d3d.D3DScreenUpdateManager.run(Unknown Source)
   - locked <0x2982e5e8> (a java.lang.Object)
   at java.lang.Thread.run(Unknown Source)

"TimerQueue" daemon prio=6 tid=0x05477800 nid=0x1174 waiting on condition [0x08b6f000]
   java.lang.Thread.State: WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for  <0x24700468> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
   at java.util.concurrent.locks.LockSupport.park(Unknown Source)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
   at java.util.concurrent.DelayQueue.take(Unknown Source)
   at javax.swing.TimerQueue.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

"ConsoleTraceListener" daemon prio=6 tid=0x05476000 nid=0x1208 in Object.wait() [0x0896f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x29825358> (a com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$BoundedStringBuffer)
   at com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$ConsoleWriterThread.run(Unknown Source)
   - locked <0x29825358> (a com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$BoundedStringBuffer)

"thread applet-com.foo.Uploader.class-1" prio=4 tid=0x05476400 nid=0x1958 in Object.wait() [0x0844d000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x247005f8> (a sun.plugin2.message.Queue)
   at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
   - locked <0x247005f8> (a sun.plugin2.message.Queue)
   at sun.plugin2.message.Pipe.receive(Unknown Source)
   at sun.plugin2.main.client.MessagePassingExecutionContext.getProxyList(Unknown Source)
   at sun.plugin2.main.client.PluginProxySelector.select(Unknown Source)
   - locked <0x298c6bd0> (a sun.plugin2.main.client.PluginProxySelector)
   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
   - locked <0x247006f0> (a sun.net.www.protocol.http.HttpURLConnection)
   at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
   at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
   at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
   at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
   at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
   - locked <0x24700968> (a java.lang.Object)
   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
   - locked <0x247009c0> (a sun.net.www.protocol.http.HttpURLConnection)
   at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
   at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
   at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
   at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
   at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
   at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
   at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
   at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
   at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
   - locked <0x24702b38> (a sun.plugin.net.protocol.jar.CachedJarURLConnection)
   at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
   - locked <0x24702b38> (a sun.plugin.net.protocol.jar.CachedJarURLConnection)
   at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
   at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
   at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
   at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
   at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
   at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
   - locked <0x29825d50> (a com.sun.deploy.security.DeployURLClassPath)
   at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
   - locked <0x298c6be8> (a sun.plugin2.applet.Applet2ClassLoader)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
   - locked <0x298c6c88> (a sun.plugin2.applet.Applet2ClassLoader)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
   - locked <0x298c6c88> (a sun.plugin2.applet.Applet2ClassLoader)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

"AWT-EventQueue-1" prio=6 tid=0x05474c00 nid=0x181c waiting on condition [0x082ee000]
   java.lang.Thread.State: RUNNABLE
   at com.sun.deploy.uitoolkit.ui.ConsoleHelper.dumpAllStacksImpl(Native Method)
   at com.sun.deploy.uitoolkit.ui.ConsoleHelper.dumpAllStacks(Unknown Source)
   at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow$2.actionPerformed(Unknown Source)
   at javax.swing.JComponent$ActionStandin.actionPerformed(Unknown Source)
   at javax.swing.SwingUtilities.notifyAction(Unknown Source)
   at javax.swing.JComponent.processKeyBinding(Unknown Source)
   at javax.swing.KeyboardManager.fireBinding(Unknown Source)
   at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
   at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
   at javax.swing.JComponent.processKeyBindings(Unknown Source)
   at javax.swing.JComponent.processKeyEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)

"JVM[id=1]-Heartbeat" daemon prio=6 tid=0x05475800 nid=0x1834 in Object.wait() [0x0851f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c6f68> (a sun.plugin2.main.client.PluginMain$Heartbeat)
   at sun.plugin2.main.server.HeartbeatThread.run(Unknown Source)
   - locked <0x298c6f68> (a sun.plugin2.main.client.PluginMain$Heartbeat)

"AWT-EventQueue-2" prio=4 tid=0x05475000 nid=0x19b4 waiting on condition [0x083af000]
   java.lang.Thread.State: WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for  <0x298c7058> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
   at java.util.concurrent.locks.LockSupport.park(Unknown Source)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
   at java.awt.EventQueue.getNextEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)

"Applet 1 LiveConnect Worker Thread" prio=4 tid=0x05474400 nid=0x1adc in Object.wait() [0x0833f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c7138> (a java.lang.Object)
   at java.lang.Object.wait(Object.java:503)
   at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
   - locked <0x298c7138> (a java.lang.Object)
   at java.lang.Thread.run(Unknown Source)

"Browser Side Object Cleanup Thread" prio=6 tid=0x05474000 nid=0x17a8 in Object.wait() [0x0826f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c71c0> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   - locked <0x298c71c0> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   at sun.plugin2.main.client.LiveConnectSupport$BrowserSideObjectCleanupThread.run(Unknown Source)

"CacheCleanUpThread" daemon prio=6 tid=0x05473800 nid=0x1a2c in Object.wait() [0x07f7f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c71e0> (a com.sun.deploy.cache.CleanupThread)
   at java.lang.Object.wait(Object.java:503)
   at com.sun.deploy.cache.CleanupThread.run(Unknown Source)
   - locked <0x298c71e0> (a com.sun.deploy.cache.CleanupThread)

"CacheMemoryCleanUpThread" daemon prio=6 tid=0x05459c00 nid=0x156c in Object.wait() [0x0812f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c72d0> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   - locked <0x298c72d0> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   at com.sun.deploy.cache.MemoryCache$LoadedResourceCleanupThread.run(Unknown Source)

"SysExecutionTheadCreator" daemon prio=6 tid=0x05431000 nid=0xc8c in Object.wait() [0x080cf000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c72f0> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
   at java.lang.Object.wait(Object.java:503)
   at sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator.run(Unknown Source)
   - locked <0x298c72f0> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)

"AWT-EventQueue-0" prio=6 tid=0x05429000 nid=0x19f0 waiting on condition [0x07eaf000]
   java.lang.Thread.State: WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for  <0x298c73d0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
   at java.util.concurrent.locks.LockSupport.park(Unknown Source)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
   at java.awt.EventQueue.getNextEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)

"AWT-Windows" daemon prio=6 tid=0x05424c00 nid=0xb00 runnable [0x0110f000]
   java.lang.Thread.State: RUNNABLE
   at sun.awt.windows.WToolkit.eventLoop(Native Method)
   at sun.awt.windows.WToolkit.run(Unknown Source)

"AWT-Shutdown" prio=6 tid=0x05424400 nid=0x1ac0 in Object.wait() [0x07c6f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c7538> (a java.lang.Object)
   at java.lang.Object.wait(Object.java:503)
   at sun.awt.AWTAutoShutdown.run(Unknown Source)
   - locked <0x298c7538> (a java.lang.Object)
   at java.lang.Thread.run(Unknown Source)

"Java2D Disposer" daemon prio=10 tid=0x05423c00 nid=0x1c4 in Object.wait() [0x07cdf000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c75c8> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   - locked <0x298c75c8> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   at sun.java2d.Disposer.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

"Java Plug-In Pipe Worker Thread (Client-Side)" daemon prio=6 tid=0x05421c00 nid=0x17a0 runnable [0x07bff000]
   java.lang.Thread.State: RUNNABLE
   at sun.plugin2.os.windows.Windows.ReadFile0(Native Method)
   at sun.plugin2.os.windows.Windows.ReadFile(Unknown Source)
   at sun.plugin2.ipc.windows.WindowsNamedPipe.read(Unknown Source)
   at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.read(Unknown Source)
   at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.readByte(Unknown Source)
   at sun.plugin2.message.AbstractSerializer.readInt(Unknown Source)
   at sun.plugin2.message.transport.SerializingTransport.read(Unknown Source)
   at sun.plugin2.message.Pipe$WorkerThread.run(Unknown Source)

"Timer-0" prio=6 tid=0x05401800 nid=0xb88 in Object.wait() [0x078af000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c7900> (a java.util.TaskQueue)
   at java.lang.Object.wait(Object.java:503)
   at java.util.TimerThread.mainLoop(Unknown Source)
   - locked <0x298c7900> (a java.util.TaskQueue)
   at java.util.TimerThread.run(Unknown Source)

"traceMsgQueueThread" daemon prio=6 tid=0x053af000 nid=0xd24 in Object.wait() [0x04d9f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x2980afd8> (a java.util.ArrayList)
   at java.lang.Object.wait(Object.java:503)
   at com.sun.deploy.trace.Trace$TraceMsgQueueChecker.run(Unknown Source)
   - locked <0x2980afd8> (a java.util.ArrayList)
   at java.lang.Thread.run(Unknown Source)

"Service Thread" daemon prio=6 tid=0x00989c00 nid=0x11cc runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread0" daemon prio=10 tid=0x00988c00 nid=0xd14 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x00987000 nid=0x1214 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x00983c00 nid=0x1764 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x00963800 nid=0x15f0 in Object.wait() [0x04e3f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c7b88> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   - locked <0x298c7b88> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" daemon prio=10 tid=0x00962000 nid=0x600 in Object.wait() [0x04a0f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c6ba0> (a java.lang.ref.Reference$Lock)
   at java.lang.Object.wait(Object.java:503)
   at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
   - locked <0x298c6ba0> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x0024dc00 nid=0x530 in Object.wait() [0x0039f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c7c10> (a sun.plugin2.message.Queue)
   at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
   - locked <0x298c7c10> (a sun.plugin2.message.Queue)
   at sun.plugin2.message.Pipe.receive(Unknown Source)
   at sun.plugin2.main.client.PluginMain.mainLoop(Unknown Source)
   at sun.plugin2.main.client.PluginMain.run(Unknown Source)
   at sun.plugin2.main.client.PluginMain.main(Unknown Source)

"VM Thread" prio=10 tid=0x00960c00 nid=0xe34 runnable 

"VM Periodic Task Thread" prio=10 tid=0x0098d000 nid=0x17ec waiting on condition 

plugin2.main.client.PluginMain.mainLoop(Unknown Source)
   at sun.plugin2.main.client.PluginMain.run(Unknown Source)
   at sun.plugin2.main.client.PluginMain.main(Unknown Source)

"VM Thread" prio=10 tid=0x00960c00 nid=0xe34 runnable 

"VM Periodic Task Thread" prio=10 tid=0x0098d000 nid=0x17ec waiting on condition 


----------------------------------------------------
Done.

查看堆栈转储,我的猜测是它试图在获取 applet jar(与 HTTP 请求一起发送)之前获取 cookie,但 getCookie() 调用挂起。

我在网上搜索过任何可能遇到过这个问题的人,但没有找到任何东西。

有没有人看过这个?如果是这样 - 是否有解决方法?

注意:发生这种情况时,Chrome 页面变得完全没有响应,并且我收到“Kill Page”提示。

这发生在 JRE 1.6.0.29 或 1.7.0.1

更新:我忘了说,如果我在本地服务器上测试它(Apache 在我的开发机器上的 VirtualBox 中的 Linux 上运行),我不会遇到任何问题。

最佳答案

看看你的转储,我认为你没有遇到死锁(至少在线程级别没有),你的主线程似乎在无休止地等待消息:

"main" prio=6 tid=0x0024dc00 nid=0x530 in Object.wait() [0x0039f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x298c7c10> (a sun.plugin2.message.Queue)
...

通过谷歌搜索我发现了这个问题:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6668033

有关使用 LiveConnect(小程序和浏览器的 javascript 引擎之间的桥梁)的错误。我会尝试关闭 javascript 并查看小程序是否仍然挂起(然后是其他问题)或者您的问题是否由此问题引起。

另一个提示可能是此链接(挂起特定于 chrome):

https://github.com/CoderLine/alphaTab/issues/17

提到了可能的解决方法。

关于使用 JRE 1.6.0.29 或 1.7.0.1 的 Win 7 64 上的 Chrome 上的 Java 小程序死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7885715/

相关文章:

java - Spring MVC 中的小程序 : ClassNotFound

java - 如何减少该方法的重复性?

java - 为什么这个正则表达式在 Java 中这么慢?

java - 我需要帮助了解如何在 Java 小程序中编写双缓冲代码

java - 非捕获组正则表达式在 Java 中不起作用

Java Applet 文件输入

Java Applet 使用 Paint 方法时遇到的问题

java - 警告依赖于未始终显示的 Caller-Allowable-Codebase 属性

Java 8 |查找具有最大值(value)大小的 map 条目

xslt - Java/XSL : Transformation result different between jre 1. 5 和 jre 1.6