在Mac OS X 10.9.4上使用对话框时,我们的Java applet有时会挂起。始终使用相同的线程转储:
"AWT-EventQueue-2" prio=5 tid=0x00007fb599138800 nid=0xbd03 runnable [0x000000010fa75000]
java.lang.Thread.State: RUNNABLE
at sun.lwawt.macosx.CAccessible.selectionChanged(Native Method)
at sun.lwawt.macosx.CAccessible.access$300(CAccessible.java:44)
at sun.lwawt.macosx.CAccessible$AXTextChangeNotifier.caretUpdate(CAccessible.java:138)
at javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:407)
at javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:4417)
at javax.swing.text.JTextComponent$MutableCaretEvent.mouseReleased(JTextComponent.java:4473)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6516)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at java.awt.Component.show(Component.java:1655)
at java.awt.Component.setVisible(Component.java:1607)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1005)
"RMI TCP Connection(11)-127.0.0.1" daemon prio=5 tid=0x00007fb59989a800 nid=0x11f03 runnable [0x000000011a78f000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
- locked <0x00000007f61dbab8> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(FilterInputStream.java:83)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:538)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000007fecbf608> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"RMI TCP Connection(9)-127.0.0.1" daemon prio=5 tid=0x00007fb599404800 nid=0x11d03 runnable [0x000000011a68c000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
- locked <0x00000007f635acf0> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(FilterInputStream.java:83)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:538)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000007fecc0c90> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"RMI TCP Accept-0" daemon prio=5 tid=0x00007fb59cb8a000 nid=0xdb4f runnable [0x0000000117eb6000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
at java.net.ServerSocket.implAccept(ServerSocket.java:530)
at java.net.ServerSocket.accept(ServerSocket.java:498)
at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:52)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:388)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:360)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- None
"Java Plug-In Pipe Worker Thread (Client-Side)" daemon prio=5 tid=0x00007fb59a137800 nid=0xab07 runnable [0x000000010f0f8000]
java.lang.Thread.State: RUNNABLE
at com.sun.deploy.net.socket.UnixSocketImpl.unStreamSocketRead(Native Method)
at com.sun.deploy.net.socket.UnixDomainSocket.read(Unknown Source)
at com.sun.deploy.net.socket.UnixDomainSocket.read(Unknown Source)
at sun.plugin2.ipc.unix.DomainSocketNamedPipe.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)
Locked ownable synchronizers:
- None
"AppKit Thread" daemon prio=5 tid=0x00007fb5990b0800 nid=0xd07 runnable [0x00007fff5e484000]
java.lang.Thread.State: RUNNABLE
at sun.lwawt.macosx.LWCToolkit.doAWTRunLoop(Native Method)
at sun.lwawt.macosx.LWCToolkit.invokeAndWait(LWCToolkit.java:570)
at sun.lwawt.macosx.LWCToolkit.invokeAndWait(LWCToolkit.java:511)
at sun.lwawt.macosx.CAccessibility.invokeAndWait(CAccessibility.java:75)
at sun.lwawt.macosx.CAccessibility.accessibilityHitTest(CAccessibility.java:388)
Locked ownable synchronizers:
- None
它在Native方法CAccessible.selectionChanged()。
中挂起挂起是不可预测的,但总是在用户使用对话框时。 挂起从Java 7 Update 55,较旧的Java版本或其他操作系统(windows,linux)开始运行,没有这个问题。
OS = Mac OS X 10.9.4
Java =从Java 7u55开始,在7u67和Java 8模拟。
我找不到任何问题,有什么帮助吗?谢谢......
答案 0 :(得分:2)
在Java 8u65中遇到这个问题。遇到这张常备的OpenJDK门票:
https://bugs.openjdk.java.net/browse/JDK-8068222
错误报告的评论提到该问题可能来自OSX的VoiceOver辅助功能。禁用画外音不会解决问题,并且线程锁会继续发生,最终会完全锁定应用程序。
然而,通过进一步搜索,我遇到了这个SO question,暗示了应用程序可访问性问题可能存在的问题。我在该帖子中听到了答案并禁用了System Preferences > Security & Privacy > Accessibility
中的所有应用程序,并且没有再次出现错误。我能够通过逐个重新启用应用程序并随着时间的推移进行测试来识别有问题的应用程序。不是一个理想的解决方案,但在我的情况下是一个功能性的解决方法。
答案 1 :(得分:-1)
使用SwingUtilities.invokeAndWait作为包装器。 有关详细信息,请参阅http://springflex.blogspot.com/2014/09/my-practices-to-resolve-applet-stuck.html。