spring 定时器 @Component 执行两次 问题解决
我的问题原因 是 因为我的定时器配置在SpringMVC的配置文件applicationContext.xml中,而web.xml中ContextLoaderListener 和 DispatcherServlet都会扫描这个文件。故而项目启动时定时器会执行两次。所以 只需要将 定时器配置单独 配成一个文件 applicationContext-task.xml,在ContextLoade
原创
2017-08-02 11:16:04 ·
2062 阅读 ·
0 评论