从Spring 3迁移到Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean [英] Migrating from Spring 3 to Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean

查看:1656
本文介绍了从Spring 3迁移到Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to migrate from spring 3.0.5 to spring 4.1.X .

Spring 3的Class命名为org.springframework.scheduling.quartz。 CronTriggerBean

Spring 3 has Class named as "org.springframework.scheduling.quartz.CronTriggerBean"

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

But Spring 4 doesn't include this class name.


[5/28/15 20:10:16:798 EDT] 00000092 ClassPathXmlA W
org.springframework.context.support.AbstractApplicationContext
__refresh上下文初始化期间遇到的异常 - 取消刷新尝试
org .springframework.beans.factory.CannotLoadBeanClassException:
找不到类名为'beanIdName'的
bean的类[org.springframework.scheduling.quartz.CronTriggerBean]
[config /弹簧/ WxsCacheContext.xml];嵌套异常是
java.lang.ClassNotFoundException:
org.springframework.scheduling.quartz.CronTriggerBean
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328 )

[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的替代品,它具有相同的类别。但没有运气。

I have tried alternative like "spring-support" which has the same class. But no luck.

获得该罐后,它给出了关于石英的错误

After getting that jar, it is giving errors about the quartz


[5/28/15 15:37:02:665 EDT] 0000006e SystemOut O ERROR(?:?) -
java.lang.Exception:来自
的Bean SpringUtils.getSpringBean(hostnameVerifierSetter)错误消息:
无法初始化组定义。组资源名称
[classpath *:beanRefFactory.xml],工厂密钥[beanContext];嵌套的
异常是org.springframework.beans.factory.BeanCreationException:
在URL
中定义名为'beanContext'的bean时出错[file:/ C:/ Program%20Files%20(x86) )/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/cellName/Project.ear/configurations/beanRefFactory.xml]:
通过构造函数的Bean实例化失败;嵌套异常是
org.springframework.beans.BeanInstantiationException:无法
实例化
[org.springframework.context.support.ClassPathXmlApplicationContext]:
构造函数抛出异常;嵌套异常是
java.lang.NoClassDefFoundError:org.quartz.impl.JobDetailImpl

[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如下所示

From Spring 3.1+, Change the Class names for the CronTriggerFactoryBean & JobDetailFactoryBean as like below

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

所以你的步骤是:

更改


CronTriggerBean to CronTriggerFactoryBean

JobDetailBean到
JobDetailFactoryBean

CronTriggerBean to CronTriggerFactoryBean
JobDetailBean to JobDetailFactoryBean

这篇关于从Spring 3迁移到Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆