| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1604 人关注过本帖
标题:spring定时器启动了但不执行任务
只看楼主 加入收藏
rareliu
Rank: 2
等 级:论坛游民
帖 子:44
专家分:28
注 册:2007-10-13
结帖率:0
收藏
已结贴  问题点数:10 回复次数:1 
spring定时器启动了但不执行任务
application.xml中定时器相关的配置:
XML code
<bean id="mediaManager" name="mediaManager"
        class="cn.biz.datacenter.basedata.impl.MediaManager">
        <aop:scoped-proxy proxy-target-class="false" />
    </bean>
 <bean id="buildMediaList"
       class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
      <property name="targetObject" ref="mediaManager" />
      <property name="targetMethod" value="buildMediaList" />
    </bean>
<bean id="buildMediaListTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="buildMediaList" />
        <property name="cronExpression" value="10 25 17 * * ?" />
    </bean>
 <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref bean="buildMediaListTrigger" />
               
            </list>
        </property>
    </bean>



应用启动时定时器部分的启动日志:
Java code
Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
Quartz Scheduler v.1.6.5 created.
RAMJobStore initialized.
Quartz scheduler 'catcherScheduler' initialized from an externally provided properties instance.
Quartz scheduler version: 1.6.5
JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@11669f2
Starting Quartz Scheduler now
Scheduler catcherScheduler_$_NON_CLUSTERED started.
==================== Startup CatcherManager ====================
Fetch all BSD_SCHEDULE, and put them into MAP
Hibernate: select bsd_schedu0_.ID as ID43_, bsd_schedu0_.NAME as NAME43_, bsd_schedu0_.RUNNING_TYPE as RUNNING3_43_, bsd_schedu0_.RUNNING_PARAM as RUNNING4_43_, bsd_schedu0_.SCHEDULE_TYPE as SCHEDULE5_43_, bsd_schedu0_.YEAR as YEAR43_, bsd_schedu0_.MONTH as MONTH43_, bsd_schedu0_.DAY as DAY43_, bsd_schedu0_.WEEK as WEEK43_, bsd_schedu0_.HOUR as HOUR43_, bsd_schedu0_.MINUTE as MINUTE43_, bsd_schedu0_.CRON as CRON43_, bsd_schedu0_.JOB_NAME as JOB13_43_, bsd_schedu0_.PRIORITY as PRIORITY43_, bsd_schedu0_.SYSTEM_TASK as SYSTEM15_43_, bsd_schedu0_.AVAILABLE as AVAILABLE43_, bsd_schedu0_.OLD_SID as OLD17_43_ from icrom.BSD_SCHEDULE bsd_schedu0_ where bsd_schedu0_.AVAILABLE=1
Add CatcherJobListener to CatcherScheduler.
Arrange all BSD_SCHEDULE into, and put them into CatcherScheduler.
Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
Quartz Scheduler v.1.6.5 created.
RAMJobStore initialized.
Quartz scheduler 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' initialized from an externally provided properties instance.
Quartz scheduler version: 1.6.5
JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@1e9d810
Starting Quartz Scheduler now
Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED started.



根据配置,此任务应该是在下午5点25分执行的,但应用确没有执行,
请各位前辈帮忙看看是哪里出问题了!
谢谢
搜索更多相关主题的帖子: spring 定时器 任务 
2010-06-08 17:58
pigpigpigxk
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:26
专家分:109
注 册:2010-5-27
收藏
得分:10 
可能是任务出错了?先让你的任务简单打印出一行字试试。
2010-06-08 22:15
快速回复:spring定时器启动了但不执行任务
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.082810 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved