java crontriggerbean,从Spring 3迁移到Spring 4 – org.springframework.scheduling.quartz.CronTriggerBean…

java crontriggerbean,从Spring 3迁移到Spring 4 – org.springframework.scheduling.quartz.CronTriggerBean…I’mtryingtomigratefromspring3.0.5tospring4.1.X.Spring3hasClassnamedas”org.springframework.scheduling.quartz.CronTriggerBean”ButSpring4doesn’tincludethisclassname.[5/28/1520:10:…

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

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

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

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 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)

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 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

解决方案

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

So your steps are:

Change

CronTriggerBean to CronTriggerFactoryBean

JobDetailBean to

JobDetailFactoryBean

今天的文章java crontriggerbean,从Spring 3迁移到Spring 4 – org.springframework.scheduling.quartz.CronTriggerBean…分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/29147.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注