Spring task任务xml配置问题

Ierson 2016-04-22 11:05:22
配置如下,本机启动程序没问题,部署到服务器TOMCAT启动报错:
[ERROR] [10:16:41] org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 20 in XML document from file [D:\apache-tomcat-accept\webapps\ROOT\WEB-INF\classes\spring\spring-taskContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 50; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'task:scheduler' 的声明。

求大神看看这XML哪里写错了

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">




<!-- ******start********* 短信补发定时任务(整点补发) -->
<bean id="sms_Task" class="com.service.SMS.timetask.SmsTask">
</bean>

<task:scheduler id="SmsTask" pool-size="3" />
<task:scheduled-tasks scheduler="SmsTask">

<task:scheduled ref="sms_Task" method="test" cron="0 0 0/1 * * ?" />


</task:scheduled-tasks>
<!-- ******end********* -->




</beans>
...全文
215 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧