日期:2014-05-18  浏览次数:20742 次

spring Quartz定时调度问题?
我想用MethodInvokingJobDetailFactoryBean来实现定时对数据库的操作,我是按照书上配置的,为什么Tomcat启动时加载老不成功,求高手赐教:    
    我的配置如下:第一个是自己写的实际完成功能的类
<bean   id= "actualWork "
class= "com.boco.common.schedule.ActualWork ">
</bean>
   
   
  <bean   id= "job "   class= "org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean ">  
<property   name= "targetObject ">
<ref   bean= "actualWork "/>
</property>
<property   name= "targetMethod ">
<value> execute </value>
</property>

<property   name= "concurrent "   value= "false "> </property>
</bean>


<bean   id= "simpleTrigger "
class= "org.springframework.scheduling.quartz.SimpleTriggerBean ">
<property   name= "jobDetail ">
<ref   bean= "job "   />
</property>
<property   name= "startDelay "   value= "2000 "   />
<property   name= "repeatInterval "   value= "2000 "   />

</bean>
                                     
        <bean   class= "org.springframework.scheduling.quartz.SchedulerFactoryBean ">
                        <property   name= "triggers ">                        
                        <list>
                        <ref   local= "simpleTrigger "   />
                        </list>                
                        </property>      
                       
        </bean>

------解决方案--------------------
路过,Spring是个好东东,但是它的xml文件配起来太麻烦了,一点都没有Struts和Hibernate简单!我上课的时候,就属Spring听得烂了!哈!
不过定时任务老师还真讲过!哈!
不好意思!帮不上忙了!反正Spring如果运行有问题,基本就是你的xml文件配错了!仔细检查吧!