我正在使用java中的Thread來擴展Thread。此線程不斷執行一些後臺工作。但過了一段時間(約15分鐘),線程自動關閉,程序崩潰。任何請幫助如何創建一個長期運行的線程在java中執行一些後臺功能和線程必須保持活着,直到應用程序活着。但我的問題是,即使在我的應用程序關閉之前,我的線程也正在關閉。在java中有時會自動關閉線程
最好的問候, AlenLee MJ
> Exception Coming:Execution protection violation
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1000cb77, pid=1028, tid=11996
> #
> # JRE version: 7.0_10-b18
> # Java VM: Java HotSpot(TM) Client VM (23.6-b04 mixed mode, sharing windows-x86)
> # Problematic frame:
> # C 0x1000cb77
> #
> # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
> #
> # An error report file with more information is saved as:
> # E:\alen_project\QrCodeScanningAppForCCD\hs_err_pid1028.log
> #
> # If you would like to submit a bug report, please visit:
> # http://bugreport.sun.com/bugreport/crash.jsp
> # The crash happened outside the Java Virtual Machine in native code.
> # See problematic frame for where to report the bug.
> #
你可以發佈堆棧跟蹤或其他顯示線程關閉的原因嗎? – mthmulders 2013-03-27 08:43:54
除了@mthmulders之外,你還應該在你的線程中發佈一些代碼。 – guness 2013-03-27 08:45:33
我正在使用jmyron來訪問攝像頭。它是一個在JVM之外運行的線程。隨着我也使用一個正常的線程。這個正常的線程總是看照相機是否可用或相機從系統中刪除,以便我可以打印一條消息,找不到相機或類似的東西。 – alenlee 2013-03-27 08:50:19