zoukankan      html  css  js  c++  java
  • Migrating from Spring 3 to Spring 4

    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

    2 Answers

     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
  • 相关阅读:
    OpenFire源码学习之二:Mina基础知识
    revel + swagger 文档也能互动啦
    Auto Layout 在iOS屏幕适配中的使用
    iOS小技巧
    一种简易的聊天泡泡设置颜色以及添加描边的方式
    做好交互应该克服哪些问题
    jQuery .on() 绑定事件无效
    浅谈iOS的Autolayout
    img 元素无法获取高度的问题
    简易自动化部署服务器集群
  • 原文地址:https://www.cnblogs.com/wangwiz/p/9037983.html
Copyright © 2011-2022 走看看