Beyond黄家驹 2014-07-21 11:48 采纳率: 0%
浏览 1207

spring整合quartz定时任务报错,请大神们解救

web.xml中的配置

spring_mvc
org.springframework.web.servlet.DispatcherServlet

contextConfigLocation
classpath:applicationContext



spring_mvc
/

applicationContext.xml的配置
<!-- 要调用的工作类 -->

<!-- 定义调用对象和调用对象的方法 -->

<!-- 调用的类 -->



<!-- 调用类中的方法 -->

work


<!-- 定义触发时间 -->




<!-- cron表达式 -->

0 */1 * * * ?


<!-- 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 -->




        </property>
    </bean>

工作类的代码
public class QuartzJob {

public void work()
{
    System.out.println("Quartz的任务调度!!!");
}

}

测试类的代码
public class Main {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//如果配置文件中将startQuertz bean的lazy-init设置为false 则不用实例化
//context.getBean("startQuertz");
}

控制台打印的错误信息
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startQuertz' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/quartz/spi/JobFactory

Caused by: java.lang.NoClassDefFoundError: org/quartz/spi/JobFactory

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码