我正在使用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