Spring容器初始化失败(初始化失败,请问大侠我哪里配错了)

ylovep 2011-05-17 02:41:52
<?xml version="1.0" encoding="UTF-8"?>
<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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
">



<bean id="quartzJob" class="com.demo.Test.quartz_Task"></bean>

<!-- 定义调用对象和调用对象的方法 -->
<bean id="jobtask"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 调用的目标对象 -->
<property name="targetObject">
<ref bean="quartzJob" />
</property>
<!-- 调用的目标方法 -->
<property name="targetMethod">
<value>work</value>
</property>
</bean>

<!-- 简单时间的触发器 -->
<bean id="simpleTime"
class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail">
<ref bean="jobtask" />
</property>
<property name ="startDelay" >
<value >1000</value >
</property >
<property name ="period" >
<value >6000</value >
</property >
</bean>

<!-- 负载时间的触发器 -->
<bean id="doTime"
class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="jobtask" />
</property>
<!-- 定义触发的时间 -->
<property name="cronExpression">
<value>10,15,20,25,30,35,40,45,50,55 * * * * ?</value>
</property>
</bean>


<!-- 注册监听器 -->
<bean id="startquartz" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="doTime" />
</list>
</property>
</bean>
</beans>






错误:。。。。。。。。。。。。。。。

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobtask' defined in class path resource [quartz_config.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/quartz/JobDetail
...全文
233 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ylovep 2011-05-17
  • 打赏
  • 举报
回复
thank you a!!!!
wl_ldy 2011-05-17
  • 打赏
  • 举报
回复
楼主的问题是缺少Jar包啊,quartz-all-1.6.0.jar看看有没有,具体的Jar包参考:
http://applepaihs.iteye.com/blog/814574

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧