问题描述
<!--调度任务--><beanid="task"class="org.springframework.scheduling.quartz.JobDetailBean"><propertyname="jobClass"value="com.sms.util.EveryWeekTask"></property></bean><!--按频率调度--><beanid="simpleTrigger"class="org.springframework.scheduling.quartz.SimpleTriggerBean"><propertyname="jobDetail"ref="task"></property><propertyname="repeatCount"value="3"></property><propertyname="repeatInterval"value="20"></property></bean><!--按时间点调度--><beanid="cronTrigger"class="org.springframework.scheduling.quartz.CronTriggerBean"><propertyname="jobDetail"ref="task"></property><propertyname="cronExpression"value="0/10****?"></property></bean><beanid="factory"class="org.springframework.scheduling.quartz.SchedulerFactoryBean"><propertyname="triggers"><list><refbean="simpleTrigger"/><refbean="cronTrigger"/></list></property></bean>任务类publicclassEveryWeekTaskextendsQuartzJobBean{@OverrideprotectedvoidexecuteInternal(JobExecutionContextarg0)throwsJobExecutionException{System.out.println("111111");}}不执行也不报错请高手指教
解决方案
解决方案二:
解决方案三:
你实例化了一个任务对象,却木有调用它。<task:scheduled-tasks><task:scheduledref="task"method="run"cron="00/15***?"/><!--runitevery15minutes--></task:scheduled-tasks>