System.exit(0) 无法退出JVM.有没有好的办法定位问题?

RednaxelaFX 2011-11-22
嘛,我说的办法被LZ华丽的无视了…本来那应该是最方便的办法之一…
qianhd 2011-11-22
RednaxelaFX 写道
嘛,我说的办法被LZ华丽的无视了…本来那应该是最方便的办法之一…


没无视
实验室的机器忙的要死 今天看看能不能解决这个问题.
qianhd 2011-11-22
我试图用Runtime.halt()来替代System.exit()但是同样不行. 所以应该跟钩子,finalize之类的无关

初步看来可能是VNC的问题, 一会看看能不能用远程桌面上去试一下.

qianhd 2011-11-22
以下是 jstack -m -l 输出

引用

Deadlock Detection:

No deadlocks found.

----------------- 0 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x004046a6 javaw + 0x46a6
0x00403124 javaw + 0x3124
0x00403389 javaw + 0x3389
0x0039005c ????????
----------------- 1 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba48be jvm!_JVM_Clone@8 + 0x49d6e
0x6dba4c26 jvm!_JVM_Clone@8 + 0x4a0d6
0x6dbc3fe1 jvm!_JVM_Clone@8 + 0x69491
0x6db22a35 jvm!JNI_CreateJavaVM + 0x135
0x00401e3d javaw + 0x1e3d
0x0040a0cb javaw + 0xa0cb
0x0040a155 javaw + 0xa155
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 2 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeeb8d jvm!_JVM_FindSignal@4 + 0x254d
0x6dba48c9 jvm!_JVM_Clone@8 + 0x49d79
0x6dba4bdc jvm!_JVM_Clone@8 + 0x4a08c
0x6dbc8311 jvm!_JVM_Clone@8 + 0x6d7c1
0x6dbc8912 jvm!_JVM_Clone@8 + 0x6ddc2
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
----------------- 3 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba88b1 jvm!_JVM_Clone@8 + 0x4dd61
0x6dbbde24 jvm!_JVM_Clone@8 + 0x632d4
0x6db4b6fc jvm!_JVM_MonitorWait@16 + 0xcc
0x00dba5b7 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0x00db3187 * java.lang.Object.wait() bci:2 line:503 (Interpreted frame)
0x00db3187 * java.lang.ref.Reference$ReferenceHandler.run() bci:46 line:133 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 4 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba88b1 jvm!_JVM_Clone@8 + 0x4dd61
0x6dbbde24 jvm!_JVM_Clone@8 + 0x632d4
0x6db4b6fc jvm!_JVM_MonitorWait@16 + 0xcc
0x00dba5b7 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0x00db3187 * java.lang.ref.ReferenceQueue.remove(long) bci:44 line:135 (Interpreted frame)
0x00db331a * java.lang.ref.ReferenceQueue.remove() bci:2 line:151 (Interpreted frame)
0x00db331a * java.lang.ref.Finalizer$FinalizerThread.run() bci:3 line:177 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 5 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbf19a6 jvm!_JVM_FindSignal@4 + 0x5366
0x6dbf1a57 jvm!_JVM_FindSignal@4 + 0x5417
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 6 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbebb02 jvm!_JVM_Clone@8 + 0x90fb2
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 7 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba48be jvm!_JVM_Clone@8 + 0x49d6e
0x6dba4c26 jvm!_JVM_Clone@8 + 0x4a0d6
0x6dac11ac jvm + 0x411ac
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 8 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba48be jvm!_JVM_Clone@8 + 0x49d6e
0x6dba4bdc jvm!_JVM_Clone@8 + 0x4a08c
0x6dbb347c jvm!_JVM_Clone@8 + 0x5892c
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 9 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeeb8d jvm!_JVM_FindSignal@4 + 0x254d
0x6dbbef46 jvm!_JVM_Clone@8 + 0x643f6
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
----------------- 10 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba88b1 jvm!_JVM_Clone@8 + 0x4dd61
0x6dbbde24 jvm!_JVM_Clone@8 + 0x632d4
0x6db4b6fc jvm!_JVM_MonitorWait@16 + 0xcc
0x00dba5b7 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0x00db3187 * java.lang.ref.ReferenceQueue.remove(long) bci:44 line:135 (Interpreted frame)
0x00db331a * java.lang.ref.ReferenceQueue.remove() bci:2 line:151 (Interpreted frame)
0x00db331a * sun.java2d.Disposer.run() bci:3 line:145 (Interpreted frame)
0x00db3705 * java.lang.Thread.run() bci:11 line:722 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 11 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
Locked ownable synchronizers:
    - None
----------------- 12 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba88b1 jvm!_JVM_Clone@8 + 0x4dd61
0x6dbbde24 jvm!_JVM_Clone@8 + 0x632d4
0x6db4b6fc jvm!_JVM_MonitorWait@16 + 0xcc
0x00dba5b7 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0x00db3187 * java.lang.Object.wait() bci:2 line:503 (Interpreted frame)
0x00db3187 * java.util.TimerThread.mainLoop() bci:28 line:526 (Interpreted frame)
0x00db3187 * java.util.TimerThread.run() bci:1 line:505 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 13 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba88b1 jvm!_JVM_Clone@8 + 0x4dd61
0x6dbbde24 jvm!_JVM_Clone@8 + 0x632d4
0x6db4b6fc jvm!_JVM_MonitorWait@16 + 0xcc
0x00dba5b7 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0x00db3187 * java.lang.Object.wait() bci:2 line:503 (Interpreted frame)
0x00db3187 * java.util.TimerThread.mainLoop() bci:28 line:526 (Interpreted frame)
0x00db3187 * java.util.TimerThread.run() bci:1 line:505 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 14 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbeec88 jvm!_JVM_FindSignal@4 + 0x2648
0x6dba88b1 jvm!_JVM_Clone@8 + 0x4dd61
0x6dbbde24 jvm!_JVM_Clone@8 + 0x632d4
0x6db4b6fc jvm!_JVM_MonitorWait@16 + 0xcc
0x00dba5b7 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0x00db3187 * java.lang.Object.wait() bci:2 line:503 (Interpreted frame)
0x00db3187 * sun.awt.AWTAutoShutdown.run() bci:32 line:287 (Interpreted frame)
0x00db3705 * java.lang.Thread.run() bci:11 line:722 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 15 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6d19e1d3 awt!_AWTIsHeadless@0 + 0xca30x6d18e2a9 awt!_Java_sun_awt_windows_WKeyboardFocusManagerPeer_setNativeFocusOwner@12 + 0x1a
0x00dba5b7 * sun.awt.windows.WKeyboardFocusManagerPeer.setNativeFocusOwner(java.awt.peer.ComponentPeer) bci:0 (Interpreted frame)
0x00db3187 * sun.awt.windows.WKeyboardFocusManagerPeer.setCurrentFocusOwner(java.awt.Component) bci:12 line:46 (Interpreted frame)
0x00db3705 * java.awt.KeyboardFocusManager.setNativeFocusOwner(java.awt.Component) bci:46 line:618 (Interpreted frame)
0x00db3187 * java.awt.DefaultKeyboardFocusManager.dispatchEvent(java.awt.AWTEvent) bci:1178 line:603 (Interpreted frame)
0x00db33fb * java.awt.Component.dispatchEventImpl(java.awt.AWTEvent) bci:144 line:4730 (Interpreted frame)
0x00db3187 * java.awt.Container.dispatchEventImpl(java.awt.AWTEvent) bci:42 line:2287 (Interpreted frame)
0x00db3187 * java.awt.Component.dispatchEvent(java.awt.AWTEvent) bci:2 line:4686 (Interpreted frame)
0x00db3187 * sun.awt.SunToolkit$4.run() bci:26 line:588 (Interpreted frame)
0x00db3705 * java.awt.event.InvocationEvent.dispatch() bci:47 line:251 (Interpreted frame)
0x00db3705 * java.awt.EventQueue.dispatchEventImpl(java.awt.AWTEvent, java.lang.Object) bci:21 line:705 (Interpreted frame)
0x00db3187 * java.awt.EventQueue.access$000(java.awt.EventQueue, java.awt.AWTEvent, java.lang.Object) bci:3 line:101 (Interpreted frame)
0x00db3187 * java.awt.EventQueue$3.run() bci:12 line:666 (Interpreted frame)
0x00db331a * java.awt.EventQueue$3.run() bci:1 line:664 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2d0d jvm!_JVM_Clone@8 + 0x481bd
0x6db53c3a jvm!_JVM_DoPrivileged@20 + 0x23a
0x6d48102f java!_Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2@16 + 0x17
0x00db331a * java.security.ProtectionDomain$1.doIntersectionPrivilege(java.security.PrivilegedAction, java.security.AccessControlContext, java.security.AccessControlContext) bci:28 line:76 (Interpreted frame)
0x00db3898 * java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent) bci:46 line:675 (Interpreted frame)
0x00db3187 * java.awt.EventDispatchThread.pumpOneEventForFilters(int) bci:245 line:211 (Interpreted frame)
0x00db33fb * java.awt.EventDispatchThread.pumpEventsForFilter(int, java.awt.Conditional, java.awt.EventFilter) bci:35 line:128 (Interpreted frame)
0x00db3187 * java.awt.EventDispatchThread.pumpEventsForHierarchy(int, java.awt.Conditional, java.awt.Component) bci:11 line:117 (Interpreted frame)
0x00db3187 * java.awt.EventDispatchThread.pumpEvents(int, java.awt.Conditional) bci:4 line:113 (Interpreted frame)
0x00db3187 * java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional) bci:3 line:105 (Interpreted frame)
0x00db3187 * java.awt.EventDispatchThread.run() bci:9 line:90 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - None
----------------- 16 -----------------
0x7c90e514 ntdll!KiFastSystemCallRet
0x7c802542 kernel32!WaitForSingleObject + 0x12
0x6dbf1fe3 jvm!_JVM_FindSignal@4 + 0x59a3
0x6db915b4 jvm!_JVM_Clone@8 + 0x36a64
0x00dba5b7 * sun.misc.Unsafe.park(boolean, long) bci:0 (Interpreted frame)
0x00db3187 * java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) bci:20 line:226 (Interpreted frame)
0x00db3187 * java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) bci:68 line:2082 (Interpreted frame)
0x00db3802 * java.util.concurrent.DelayQueue.take() bci:132 line:220 (Interpreted frame)
0x00db331a * javax.swing.TimerQueue.run() bci:20 line:171 (Interpreted frame)
0x00db3705 * java.lang.Thread.run() bci:11 line:722 (Interpreted frame)
0x00db0357 <StubRoutines>
0x6dba2c7e jvm!_JVM_Clone@8 + 0x4812e
0x6dc49c0e jvm!_JVM_FindSignal@4 + 0x5d5ce
0x6dba2e73 jvm!_JVM_Clone@8 + 0x48323
0x6dba2ed7 jvm!_JVM_Clone@8 + 0x48387
0x6db4cd1f jvm!jio_fprintf + 0x17f
0x6dbc433f jvm!_JVM_Clone@8 + 0x697ef
0x6dbf1549 jvm!_JVM_FindSignal@4 + 0x4f09
0x78afc6de msvcr100!_endthreadex + 0x3a
0x78afc788 msvcr100!_endthreadex + 0xe4
0x7c80b729 kernel32!GetModuleFileNameA + 0x1ba
Locked ownable synchronizers:
    - <0x10093f98>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync)

qianhd 2011-11-22
继续更新

根据jstack的信息,原先初步怀疑是VNC问题导致block在AWTIsHeadless的调用上。但是使用远程桌面连上去既然有同样的问题。看来跟VNC无关。
不知是不是与硬件配置 驱动有关。
RednaxelaFX 2011-11-22
这的stack trace看起来并没有去执行shutdown hook。


刚做了个例子,在这里:https://gist.github.com/1385536
开Groovy shell,加一个无限循环的shutdown hook,然后quit进入无限循环。

log1是正常运行中的Groovy shell。它正在等待输入。可以观察它的样子。

log2是卡在无限循环的shutdown hook里的状况。可以看到,有CreateJavaVM的那个线程的stack trace里会有java.lang.Shutdown.runHooks()存在。而楼上的stack trace里没有这个方法。看起来更像是没进入shutdown过程的状况。

顺便,楼主可以看看sun.awt.AWTAutoShutdown.run()的代码。从stack trace上可以看到这个方法正执行到mainLock.wait(),还在这个线程的主循环里,而没卡在while (isReadyToShutdown())的循环里。

也就是说你的程序并没有到达退出的条件。其它细节回头再根据stack trace好好看看。

真糟糕,OpenJDK里的AWT代码跟实际产品的差异太大,没办法用来做参考。但我觉得那个AWTIsHeadless出现在这里很诡异,本来它是只应该在初始化阶段被调用的,例如说AWT_OnLoad()里。但是看不到源码真麻烦。要不然拿这个stack trace去报个bug吧…
qianhd 2011-11-23
我再尝试一下启动参数里加 -Djava.awt.headless=false 看看有没有效果
或者用java.exe来启动.
qianhd 2011-11-23
-Djava.awt.headless=false无效

不知道为何 jstack 有时候会抛异常.
RednaxelaFX 2011-11-23
qianhd 写道
-Djava.awt.headless=false无效

嗯…跟预期的一样。这个参数本来就应该是false,如果检查到实际上就是headless的话会在很早的地方就有提示信息说参数有冲突的。

qianhd 写道
不知道为何 jstack 有时候会抛异常.

Windows上jstack -m或-F的实现还不太稳定。在JDK 7之前没把这功能放出来也是有原因的。可惜你的问题多半不能靠换操作系统来解决——操作系统的选择不在自己控制之下,对吧?
qianhd 2011-11-23
就这一台电脑上有这问题
应该是啥驱动之类的 装的不对。很奇怪的问题
原先我用JConsole看EventQueue 发现block在InputMethod上,我以为又是把默认输入法设置为中文输入法的原因,但却不是

无功而返啊~本来还能在简历上再加一笔。哈哈哈~~
Global site tag (gtag.js) - Google Analytics