Eclipse调试器总是阻止ThreadPoolExecutor没有任何明显的异常,为什么? [英] Eclipse debugger always blocks on ThreadPoolExecutor without any obvious exception, why?

查看:175
本文介绍了Eclipse调试器总是阻止ThreadPoolExecutor没有任何明显的异常,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事Eclipse平常的项目,它是一个J2EE应用程序,由Spring,Hibernate等组成。我使用Tomcat 7(没有特别的原因,我不利用任何新功能,我只是想尝试)。每次调试我的应用程序时,就会发现Eclipse调试器像已经到达断点一样弹出,但实际上它停止在一个Java源文件,即$ code ThreadPoolExecutor 。控制台上没有堆栈跟踪,它只是停止。然后,如果我点击简历,它继续下去,应用程序运行正常。这是调试器窗口中显示的内容:

 守护程序线程[http-bio-8080-exec-2](已暂停(异常RuntimeException))
ThreadPoolExecutor $ Worker.run()行:912
任务线程(线程).run()行:619

我真的不能解释这一点,因为我根本没有使用 ThreadPoolExecutor 。必须是Tomcat,Hibernate或Spring的东西。这是非常烦人的,因为我总是在调试过程中恢复。



任何线索?

解决方案

发布的堆栈跟踪表示在一个Daemon线程中遇到一个RuntimeException。这通常在运行时未被捕获,除非原始开发人员抓住并处理异常。



通常,Eclipse中的调试器被配置为在执行异常的位置暂停执行抛出,所有未知的例外。请注意,异常可能稍后处理,在堆栈帧中较低,可能不会导致线程被终止。这将导致观察到的行为。



配置Eclipse的行为很简单:

转到 > 首选项> Java > 调试,取消选中暂停执行未捕获的异常 p>

I'm working on my usual projects on Eclipse, it's a J2EE application, made with Spring, Hibernate and so on. I'm using Tomcat 7 for this (no particular reason, I don't exploit any new feature, I just wanted to try that). Every time I debug my application, it happens that Eclipse debugger pops out like it has reached a breakpoint, but it is not the case, in fact it stops on a Java source file that is ThreadPoolExecutor. There is no stack trace on the console, it just stops. Then if I click on resume it goes on and the app works perfectly. This is what shows in the debugger window:

Daemon Thread ["http-bio-8080"-exec-2] (Suspended (exception RuntimeException)) 
    ThreadPoolExecutor$Worker.run() line: 912   
    TaskThread(Thread).run() line: 619

I really can't explain this, because I'm not using ThreadPoolExecutor at all. Must be something from Tomcat, Hibernate or Spring. It's very annoying because I always have to resume during debugging.

Any clues?

解决方案

The posted stack trace indicates that a RuntimeException was encountered in a Daemon thread. This is typically uncaught at runtime, unless the original developer caught and handled the exception.

Typically, the debugger in Eclipse is configured to suspend execution at the location where the exception was thrown, on all uncaught exceptions. Note that the exception might be handled later, lower down in the stack frame and might not lead to the thread being terminated. This would be cause of the behavior observed.

Configuring the behavior of Eclipse is straightforward:
Go to Window > Preferences > Java > Debug and uncheck Suspend execution on uncaught exceptions.

这篇关于Eclipse调试器总是阻止ThreadPoolExecutor没有任何明显的异常,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆