VTK 툴킷을 설치했으며 Eclipse에서 VTK 용 Java 래퍼를 사용합니다. 내 Java 프로젝트에 vtk.jar를 추가하고 VTK 설치를 가리 키도록 환경 변수를 설정합니다. 기본적으로 작동 중입니다. vtk 클래스 등이 발견되고 프로그램이 시작됩니다. 적어도 내가 창을 보여줄 때까지 프로그램이 시작됩니다. 나는 그것을 실행하는 경우 http://www.vtk.org/Wiki/VTK/Examples/Java/Imaging/ImageTestOS-X, 코코아 예외 VTK Java
, 다음과 같은 예외가 OS-X (또는 코코아)에 의해 발생 된 UndoManager에 몇 가지 문제를 진술 : 예제 프로그램 다음과 같은 예를 들어
나는 단서가 없다 무엇을 나는이 문제를 일으키는 원인이 된 무엇이 틀리다, 누군가에게 어떤 생각을?
2012-05-22 22:48:09.093 java[925:1a03] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-833.25/Misc.subproj/NSUndoManager.m:324
2012-05-22 22:48:09.093 java[925:1a03] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2012-05-22 22:48:09.096 java[925:1a03] (
0 CoreFoundation 0x00007fff9363cf56 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8aa9fd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9363cd8a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff910a371f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 169
4 Foundation 0x00007fff9101295f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 144
5 AppKit 0x00000001025680ef -[NSApplication run] + 596
6 libvtkRendering.5.10.dylib 0x000000010ff8c2df -[vtkCocoaServer start] + 335
7 libvtkRendering.5.10.dylib 0x000000010ff8cf87 _ZN30vtkCocoaRenderWindowInteractor5StartEv + 293
8 libvtkRenderingJava.5.10.0.dylib 0x000000010f94f29e Java_vtk_vtkRenderWindowInteractor_Start_15 + 62
9 ??? 0x0000000103b70d6e 0x0 + 4357295470
10 ??? 0x0000000103b6585a 0x0 + 4357249114
)
2012-05-22 22:48:09.096 java[925:1a03] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-833.25/Misc.subproj/NSUndoManager.m:324
2012-05-22 22:48:09.096 java[925:1a03] An uncaught exception was raised
2012-05-22 22:48:09.097 java[925:1a03] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2012-05-22 22:48:09.098 java[925:1a03] (
0 CoreFoundation 0x00007fff9363cf56 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8aa9fd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9363cd8a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff910a371f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 169
4 Foundation 0x00007fff9101295f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 144
5 AppKit 0x000000010256819c -[NSApplication run] + 769
6 libvtkRendering.5.10.dylib 0x000000010ff8c2df -[vtkCocoaServer start] + 335
7 libvtkRendering.5.10.dylib 0x000000010ff8cf87 _ZN30vtkCocoaRenderWindowInteractor5StartEv + 293
8 libvtkRenderingJava.5.10.0.dylib 0x000000010f94f29e Java_vtk_vtkRenderWindowInteractor_Start_15 + 62
9 ??? 0x0000000103b70d6e 0x0 + 4357295470
10 ??? 0x0000000103b6585a 0x0 + 4357249114
)
2012-05-22 22:48:09.098 java[925:1a03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff9363cf56 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8aa9fd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9363cd8a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff910a371f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 169
4 Foundation 0x00007fff9101295f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 144
5 AppKit 0x000000010256819c -[NSApplication run] + 769
6 libvtkRendering.5.10.dylib 0x000000010ff8c2df -[vtkCocoaServer start] + 335
7 libvtkRendering.5.10.dylib 0x000000010ff8cf87 _ZN30vtkCocoaRenderWindowInteractor5StartEv + 293
8 libvtkRenderingJava.5.10.0.dylib 0x000000010f94f29e Java_vtk_vtkRenderWindowInteractor_Start_15 + 62
9 ??? 0x0000000103b70d6e 0x0 + 4357295470
10 ??? 0x0000000103b6585a 0x0 + 4357249114
)
terminate called throwing an exception
이 오류에 VM 매개 변수 리드를 제안 :
2012-05-23 09:10:18.635 java[747:307] [Java CocoaComponent compatibility mode]: Enabled
2012-05-23 09:10:18.635 java[747:307] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
2012-05-23 09:10:18.985 java[747:d303] *** -[NSConditionLock unlock]: lock (<NSConditionLock: 0x7fa108c64600> '(null)') unlocked when not locked
2012-05-23 09:10:18.985 java[747:d303] *** Break on _NSLockError() to debug.
원본 스레드를 업데이트했습니다. startOnFirstThread 매개 변수를 사용하면 잠금 해제 오류가 발생합니다. ( – user867204
이것은 이제 코코아에만 해당하며 스레딩 문제 일 수 있지만이 프레임 워크에 대한 경험이 없습니다. –