@Scheduled Tasks使独立程序要退出时JVM挂起,需要杀死JVM [英] @Scheduled Tasks keep JVM hanging when standalone program wants to exit, JVM needs to be killed
本文介绍了@Scheduled Tasks使独立程序要退出时JVM挂起,需要杀死JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在spring bug tracker中打开了这个bug.如果这里有一些聪明的人已经可以帮助我,那就太好了
i opened this bug in the spring bug tracker. would be cool if some clever people here can already help me
https://jira.springsource.org/browse/SPR-9341
推荐答案
在调度程序的守护程序属性上设置"true"-例如
Set "true" on daemon property for the scheduler - eg
<!-- task scheduling for @Scheduled annotation -->
<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
<task:executor id="myExecutor" pool-size="1" />
<bean id="myScheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler">
<property name="poolSize" value="2" />
<property name="threadNamePrefix" value="myScheduler-"/>
<property name="waitForTasksToCompleteOnShutdown" value="false" />
<property name="daemon" value="true" />
</bean>
这篇关于@Scheduled Tasks使独立程序要退出时JVM挂起,需要杀死JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文