Doutzen丶 2017-09-09 08:55 采纳率: 100%
浏览 2000
已采纳

SpringMVC+quartz 报错

配置文件:

```<!-- 执行调度任务业务类 -->

<!--  配置执行类和方法 -->
<bean id="consultJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    <property name="targetObject" ref="consultJob"></property>
    <property name="targetMethod" value="consultTypeCopy"></property>
    <property name="concurrent" value="false"></property>
</bean>

<!--  配置定时执行时间 -->
<bean id="consultTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    <property name="jobDetail" ref="consultJobDetail"></property>
    <property name="cronExpression">
        <value>0/10 * * * * ?</value>
    </property>
</bean>

<!--  配置调度资源 -->
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
      lazy-init="false" autowire="no">
    <property name="autoStartup" value="true"></property>
    <property name="startupDelay" value="0"/>
    <property name="triggers">
        <list>
            <ref local="consultTrigger"/>
        </list>
    </property>
</bean>
报错信息:

```Caused by: org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist.
    at org.quartz.simpl.RAMJobStore.storeTrigger(RAMJobStore.java:422)
    at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:932)
    at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258)
    at org.springframework.scheduling.quartz.SchedulerAccessor.addTriggerToScheduler(SchedulerAccessor.java:312)
    at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:235)
    at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:512)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    ... 57 more

使用 RAMJobStore 模式,不需要持久化到数据,启动时抛出如上异常?求解答!!

  • 写回答

5条回答

  • lkhog 2017-09-09 15:57
    关注

    Autowire注入时候报错了?错误信息太少了~是不是和autowire="no"有关~

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧