且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring Scheduler不起作用

更新时间:2023-08-24 11:36:52

如果您想使用task:annotation-driven方法并且您的@Scheduled注释不起作用,那么您很可能在上下文xml中错过了context:component-scan. 没有这一行,spring无法猜测在哪里搜索注释.

If you want to use task:annotation-driven approach and your @Scheduled annotation is not working, then you most probably missed context:component-scan in your context xml. Without this line, spring cannot guess where to search for your annotations.

<context:component-scan base-package="..." />