MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 关于spring的quratz任务调度有关问题

关于spring的quratz任务调度有关问题

www.MyException.Cn  网友分享于:2013-12-01  浏览:632次
关于spring的quratz任务调度问题
调用的方法
package   test;
public   class   TestQuarz   {
  public   void   sayHello()   {        
      System.out.println( "-----------chulai...   ");        
  }  
}

测试的类
package   test;
import   org.springframework.context.ApplicationContext;
import   org.springframework.context.support.FileSystemXmlApplicationContext;
public   class   Test   {
public   static   void   main(String[]   args)   {
ApplicationContext   a   =   new   FileSystemXmlApplicationContext(
"WebContent\\WEB-INF\\applicationContext.xml ");
}
}

spring文件配置
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   beans   PUBLIC   "-//SPRING//DTD   BEAN//EN "   "http://www.springframework.org/dtd/spring-beans.dtd ">
<beans>
<bean   id= "testQuarz "   class= "test.TestQuarz "   />
<bean   id= "helloworldTask "
class= "org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean ">
<property   name= "targetObject ">
<ref   bean= "testQuarz "   />
</property>
<property   name= "targetMethod ">
<value> sayHello </value>
</property>
</bean>
<bean   id= "simpleTrigger "
class= "org.springframework.scheduling.quartz.SimpleTriggerBean ">
<property   name= "jobDetail "   ref= "helloworldTask "   />
<property   name= "startDelay "   value= "1000 "   />
</bean>
<bean
class= "org.springframework.scheduling.quartz.SchedulerFactoryBean ">
<property   name= "triggers ">
<list>
<ref   bean= "simpleTrigger "   />
</list>
</property>
</bean>
</beans>

我运行test类的时候报这个异常
是怎么回事
帮帮忙
谢谢
2007-8-20   22:16:03   org.springframework.core.CollectionFactory   <clinit>
信息:   JDK   1.4+   collections   available
2007-8-20   22:16:04   org.springframework.beans.factory.xml.XmlBeanDefinitionReader   loadBeanDefinitions
信息:   Loading   XML   bean   definitions   from   file   [C:\Documents   and   Settings\Andy\workspace\dafasd\WebContent\WEB-INF\applicationContext.xml]
2007-8-20   22:16:04   org.springframework.context.support.AbstractRefreshableApplicationContext   refreshBeanFactory
信息:   Bean   factory   for   application   context   [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=21402567]:   org.springframework.beans.factory.support.DefaultListableBeanFactory   defining   beans   [testQuarz,helloworldTask,simpleTrigger,org.springframework.scheduling.quartz.SchedulerFactoryBean];   root   of   BeanFactory   hierarchy
2007-8-20   22:16:04   org.springframework.context.support.AbstractApplicationContext   refresh
信息:   4   beans   defined   in   application   context   [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=21402567]
2007-8-20   22:16:04   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry   destroySingletons

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有