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 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器