(未解决)MAC JAVA错误:Cocoa AWT: Not running on AppKit thread 0 when expected
Posted 柳鲲鹏
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(未解决)MAC JAVA错误:Cocoa AWT: Not running on AppKit thread 0 when expected相关的知识,希望对你有一定的参考价值。
代码功能:在MAC上,JAVA调用本地函数,产生一个SDL_Window。然后就崩溃了。
具体错误:
2022-02-25 09:16:25.302 java[547:10409] Cocoa AWT: Not running on AppKit thread 0 when expected. (
0 libawt_lwawt.dylib 0x000000010eaacb88 -[AWTWindow windowDidResignKey:] + 43
1 CoreFoundation 0x00007fff582541ac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
2 CoreFoundation 0x00007fff5825409a _CFXRegistrationPost + 442
3 CoreFoundation 0x00007fff58253de2 ___CFXNotificationPost_block_invoke + 50
4 CoreFoundation 0x00007fff58212972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
5 CoreFoundation 0x00007fff58211a0c _CFXNotificationPost + 652
6 Foundation 0x00007fff5a2ea477 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
7 AppKit 0x00007fff55a2cc89 -[NSWindow resignKeyWindow] + 867
8 AppKit 0x00007fff55973888 -[NSWindow _changeKeyAndMainLimitedOK:] + 847
9 AppKit 0x00007fff55a20e9a -[NSWindow _makeKeyRegardlessOfVisibility] + 108
10 AppKit 0x00007fff559768f4 NSPerformVisuallyAtomicChange + 146
11 AppKit 0x00007fff55a20dd1 -[NSWindow makeKeyAndOrderFront:] + 90
12 libSDL2-2.0.0.dylib 0x000000019893b1b9 Cocoa_ShowWindow + 89
13 libSDL2-2.0.0.dylib 0x000000019890d3ba SDL_ShowWindow_REAL + 90
14 libtsplayercore.dylib 0x0000000199133172 initPlayerCore + 994
15 libtsplayercore.dylib 0x000000019913bdf2 PlayerCore_CreateWithSize + 290
16 libtsplayercore.dylib 0x000000019913c9c2 Java_com_ts_apps_system_TPlayerCore_createWithSize + 130
17 ??? 0x00000001117f2087 0x0 + 4588511367
)
2022-02-25 09:16:25.302 java[547:10409] Please file a bug report at http://java.net/jira/browse/MACOSX_PORT with this message and a reproducible test case.
2022-02-25 09:16:25.303 java[547:10409] Cocoa AWT: Not running on AppKit thread 0 when expected. (
0 libawt_lwawt.dylib 0x000000010eaabdcb -[AWTWindow orderChildWindows:] + 52
1 CoreFoundation 0x00007fff582541ac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
2 CoreFoundation 0x00007fff5825409a _CFXRegistrationPost + 442
3 CoreFoundation 0x00007fff58253de2 ___CFXNotificationPost_block_invoke + 50
4 CoreFoundation 0x00007fff58212972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
5 CoreFoundation 0x00007fff58211a0c _CFXNotificationPost + 652
6 Foundation 0x00007fff5a2ea477 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
7 AppKit 0x00007fff55a2cc89 -[NSWindow resignKeyWindow] + 867
8 AppKit 0x00007fff55973888 -[NSWindow _changeKeyAndMainLimitedOK:] + 847
9 AppKit 0x00007fff55a20e9a -[NSWindow _makeKeyRegardlessOfVisibility] + 108
10 AppKit 0x00007fff559768f4 NSPerformVisuallyAtomicChange + 146
11 AppKit 0x00007fff55a20dd1 -[NSWindow makeKeyAndOrderFront:] + 90
12 libSDL2-2.0.0.dylib 0x000000019893b1b9 Cocoa_ShowWindow + 89
13 libSDL2-2.0.0.dylib 0x000000019890d3ba SDL_ShowWindow_REAL + 90
14 libtsplayercore.dylib 0x0000000199133172 initPlayerCore + 994
15 libtsplayercore.dylib 0x000000019913bdf2 PlayerCore_CreateWithSize + 290
16 libtsplayercore.dylib 0x000000019913c9c2 Java_com_ts_apps_system_TPlayerCore_createWithSize + 130
17 ??? 0x00000001117f2087 0x0 + 4588511367
)
2022-02-25 09:16:25.303 java[547:10409] Please file a bug report at http://java.net/jira/browse/MACOSX_PORT with this message and a reproducible test case.
2022-02-25 09:16:25.303 java[547:10409] Cocoa AWT: Not running on AppKit thread 0 when expected. (
0 libosxapp.dylib 0x000000010eb82144 +[ThreadUtilities getJNIEnv] + 37
1 libawt_lwawt.dylib 0x000000010eaabbcc -[AWTWindow isBlocked] + 37
2 libawt_lwawt.dylib 0x000000010eaabe1c -[AWTWindow orderChildWindows:] + 133
3 CoreFoundation 0x00007fff582541ac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
4 CoreFoundation 0x00007fff5825409a _CFXRegistrationPost + 442
5 CoreFoundation 0x00007fff58253de2 ___CFXNotificationPost_block_invoke + 50
6 CoreFoundation 0x00007fff58212972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
7 CoreFoundation 0x00007fff58211a0c _CFXNotificationPost + 652
8 Foundation 0x00007fff5a2ea477 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
9 AppKit 0x00007fff55a2cc89 -[NSWindow resignKeyWindow] + 867
10 AppKit 0x00007fff55973888 -[NSWindow _changeKeyAndMainLimitedOK:] + 847
11 AppKit 0x00007fff55a20e9a -[NSWindow _makeKeyRegardlessOfVisibility] + 108
12 AppKit 0x00007fff559768f4 NSPerformVisuallyAtomicChange + 146
13 AppKit 0x00007fff55a20dd1 -[NSWindow makeKeyAndOrderFront:] + 90
14 libSDL2-2.0.0.dylib 0x000000019893b1b9 Cocoa_ShowWindow + 89
15 libSDL2-2.0.0.dylib 0x000000019890d3ba SDL_ShowWindow_REAL + 90
16 libtsplayercore.dylib 0x0000000199133172 initPlayerCore + 994
17 libtsplayercore.dylib 0x000000019913bdf2 PlayerCore_CreateWithSize + 290
18 libtsplayercore.dylib 0x000000019913c9c2 Java_com_ts_apps_system_TPlayerCore_createWithSize + 130
19 ??? 0x00000001117f2087 0x0 + 4588511367
)
2022-02-25 09:16:25.303 java[547:10409] Please file a bug report at http://java.net/jira/browse/MACOSX_PORT with this message and a reproducible test case.
2022-02-25 09:16:25.306 java[547:10409] Apple AWT Internal Exception: java.lang.StackOverflowError
at com.ts.apps.system.TPlayerCore.createWithSize(Native Method)
at com.ts.apps.system.TPlayerCoreFrame$1.run(TPlayerCoreFrame.java:614)
at java.lang.Thread.run(Thread.java:748)
2022-02-25 09:16:25.306 java[547:10409] *** Terminating app due to uncaught exception 'JavaNativeException', reason: 'Internal JNF Error: failed calling Throwable.toString()'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff582c332b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff7ec51942 objc_exception_throw + 48
2 CoreFoundation 0x00007fff582c3279 -[NSException raise] + 9
3 JavaNativeFoundation 0x00007fff5bdb08a0 JNFCallBooleanMethod + 218
4 libawt_lwawt.dylib 0x000000010eaabc08 -[AWTWindow isBlocked] + 97
5 libawt_lwawt.dylib 0x000000010eaabe1c -[AWTWindow orderChildWindows:] + 133
6 CoreFoundation 0x00007fff582541ac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
7 CoreFoundation 0x00007fff5825409a _CFXRegistrationPost + 442
8 CoreFoundation 0x00007fff58253de2 ___CFXNotificationPost_block_invoke + 50
9 CoreFoundation 0x00007fff58212972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
10 CoreFoundation 0x00007fff58211a0c _CFXNotificationPost + 652
11 Foundation 0x00007fff5a2ea477 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
12 AppKit 0x00007fff55a2cc89 -[NSWindow resignKeyWindow] + 867
13 AppKit 0x00007fff55973888 -[NSWindow _changeKeyAndMainLimitedOK:] + 847
14 AppKit 0x00007fff55a20e9a -[NSWindow _makeKeyRegardlessOfVisibility] + 108
15 AppKit 0x00007fff559768f4 NSPerformVisuallyAtomicChange + 146
16 AppKit 0x00007fff55a20dd1 -[NSWindow makeKeyAndOrderFront:] + 90
17 libSDL2-2.0.0.dylib 0x000000019893b1b9 Cocoa_ShowWindow + 89
18 libSDL2-2.0.0.dylib 0x000000019890d3ba SDL_ShowWindow_REAL + 90
19 libtsplayercore.dylib 0x0000000199133172 initPlayerCore + 994
20 libtsplayercore.dylib 0x000000019913bdf2 PlayerCore_CreateWithSize + 290
21 libtsplayercore.dylib 0x000000019913c9c2 Java_com_ts_apps_system_TPlayerCore_createWithSize + 130
22 ??? 0x00000001117f2087 0x0 + 4588511367
)
libc++abi.dylib: terminating with uncaught exception of type JNFException
- 尝试解决一:使用Thread.join(),失败
- 尝试解决二:使用invokeLater(),失败
以上是关于(未解决)MAC JAVA错误:Cocoa AWT: Not running on AppKit thread 0 when expected的主要内容,如果未能解决你的问题,请参考以下文章
全网首发:java[50077:153519] Cocoa AWT: Not running on AppKit thread 0 when expected. libawt_lwawt.dylib
线程“主”java.awt.AWTError 中的异常:未找到辅助技术
cocoa错误3840 NSJSONSerialization的解决方法
(Cocoa 错误 3840。)”(JSON 文本没有以数组或对象开头,并且允许未设置片段的选项。)