首页 新闻 会员 周边

spring任务调度

0
悬赏园豆:50 [已关闭问题] 关闭于 2016-08-30 17:39

各位大神,刚刚配置任务调度的时候出错了,求解,

这个是xml的命名空间:

<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:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       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.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"
           >

配置任务:

<bean id="logTask" class="com.uec.village.web.action.task.ClearLogTask"/>
    <task:scheduled-tasks scheduler="myScheduler">
        <!--     表示每个月15号凌晨2:30执行     -->
<!--         <task:scheduled ref="logTask" method="clearUecMallLogTask" cron="0 30 2 15 * ?"/> -->
        <task:scheduled ref="logTask" method="clearUecMallLogTask" cron="1/5 * * * * *"/>
    </task:scheduled-tasks>
    <task:scheduler id="myScheduler" pool-size="10"/> 

然后启动项目的时候就说task命名空间出错了:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/task]
Offending resource: class path resource [beans.xml]

求解,江湖救急,谢谢了!!!

_萨瓦迪卡的主页 _萨瓦迪卡 | 初学一级 | 园豆:114
提问于:2016-08-30 16:16
< >
分享
所有回答(2)
0

哥就喜欢这种刚发的帖子,如果火了就是个前排,可以混个脸熟,说不定谁好心就给粉了…稳赚不赔;如果沉了就感觉是我弄沉的,很有成就感,还能捞经验

三胖他爹 | 园豆:116 (初学一级) | 2016-08-30 16:20

 - =。卧擦

支持(0) 反对(0) _萨瓦迪卡 | 园豆:114 (初学一级) | 2016-08-30 16:22
0

你的applicationContext.xml里引用了applicationContext-framework.xml文件,异常信息是说因为applicationContext-framework.xml不存在所以无法打开,所以请先检查applicationContext-framework.xml文件是否存在。

另外你贴的applicationContext.xml的代码里classpath被写成了classpayh,不知是你提问时写错的还是你文件里就是这么写的,请检查下文件,如果有错也一并改正

文墨挚爱 | 园豆:206 (菜鸟二级) | 2016-08-30 16:32

我贴的代码里面没有classpath呐,还有,applicationContext.xml里也没有applicationContext-framework.xml。是我眼花了嘛。

支持(0) 反对(0) _萨瓦迪卡 | 园豆:114 (初学一级) | 2016-08-30 16:36

@_萨瓦迪卡: 那我就不知道了,你可以试试百度下,或许能找到一点线索

支持(0) 反对(0) 文墨挚爱 | 园豆:206 (菜鸟二级) | 2016-08-30 16:38
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册