使用 Spring 的集成 api with Quartz
,对有未捕获异常的 cron 作业有什么影响?由于 cronbean/worker 线程没有捕获异常,这是否意味着线程已死并且无法返回SimpleThreadPool?如果它死了并且没有回到池中,这是否意味着 SimpleThreadPool 将需要创建新线程,如果说这种情况发生多次从而清空池?
这是堆栈跟踪的示例:
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:276) - Invocation of method 'doCronJob' on target class [abc.package.ServiceImpl] failed
java.io.FileNotFoundException: http://www.website.com
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1457)
at abc.package.ServiceImpl.doCronJob(ServiceImpl.java:453)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:208)
**at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)**