gpt4 book ai didi

java - 从 Spring 3 迁移到 Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean

转载 作者:IT老高 更新时间:2023-10-28 13:46:19 29 4
gpt4 key购买 nike

我正在尝试从 spring 3.0.5 迁移到 spring 4.1.X 。

Spring 3 有一个名为“org.springframework.scheduling.quartz.CronTriggerBean”的类

但是 Spring 4 不包含这个类名。

[5/28/15 20:10:16:798 EDT] 00000092 ClassPathXmlA W org.springframework.context.support.AbstractApplicationContext __refresh Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.scheduling.quartz.CronTriggerBean] for bean with name 'beanIdName' defined in class path resource [config/spring/WxsCacheContext.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.scheduling.quartz.CronTriggerBean at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)

我尝试过类似“spring-support”的替代方法,它具有相同的类。但没有运气。

得到那个 jar 后,它给出了关于 quartz 的错误

[5/28/15 15:37:02:665 EDT] 0000006e SystemOut O ERROR (?:?) - java.lang.Exception: Bean from SpringUtils.getSpringBean(hostnameVerifierSetter) error message: Unable to initialize group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [beanContext]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanContext' defined in URL [file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/cellName/Project.ear/configurations/beanRefFactory.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org.quartz.impl.JobDetailImpl

最佳答案

从 Spring 3.1+ 开始,更改 CronTriggerFactoryBean 和 JobDetailFactoryBean 的类名称,如下所示

   org.springframework.scheduling.quartz.CronTriggerBean 
org.springframework.scheduling.quartz.CronTriggerFactoryBean
org.springframework.scheduling.quartz.JobDetailBean
org.springframework.scheduling.quartz.JobDetailFactoryBean

所以你的步骤是:

改变

CronTriggerBean to CronTriggerFactoryBean
JobDetailBean to JobDetailFactoryBean

关于java - 从 Spring 3 迁移到 Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30520265/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com