使用Spring的@Scheduled实现定时任务以及解决无法执行定时任务

Spring配置文件中需要配置的内容:

xmlns:task="http://www.springframework.org/schema/task"  
http://www.springframework.org/schema/task     http://www.springframework.org/schema/task/spring-task-3.2.xsd

前几天遇到一个bug。是因为我将上面这两个玩意换行所导致的,所以说最好将这些东西饿写在一行。

配置内容位置

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx" 
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:task="http://www.springframework.org/schema/task"  
	xsi:schemaLocation="
    http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/tx       http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
    http://www.springframework.org/schema/aop      http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
    http://www.springframework.org/schema/task     http://www.springframework.org/schema/task/spring-task-3.2.xsd
    http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context-3.2.xsd">

猜你喜欢

转载自blog.csdn.net/qq_22570497/article/details/77934146
今日推荐