弹簧批兼容性:弹簧批2.2.7弹簧芯2.5.6

时间:2015-06-04 21:33:51

标签: spring-batch

我们最近开始使用spring批处理在我们的应用程序中实现批处理。我们目前使用的弹簧芯是2.5.6。然而,弹簧批次2.2.7使用弹簧芯3.2.9。 我试图从spring-batch依赖项中排除spring-core,spring-beans,但我仍面临以下异常。我想知道spring-batch 2.2.7是否适用于spring-core 2.5.6?

Caused by: java.lang.NoClassDefFoundError: org/springframework/core/serializer/Serializer
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
        at java.lang.Class.getDeclaredConstructors(Unknown Source)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determi
neCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:191)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineCon
structorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:859)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanIn
stance(AbstractAutowireCapableBeanFactory.java:831)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingleton
FactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:682)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFa
ctoryBean(AbstractAutowireCapableBeanFactory.java:614)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFac
tory.java:450)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(
DefaultListableBeanFactory.java:223)
        at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(Bea
nFactoryUtils.java:187)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidat
es(DefaultListableBeanFactory.java:652)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(De
faultListableBeanFactory.java:610)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$Autowir
edFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:412)
        ... 18 more
Caused by: java.lang.ClassNotFoundException: org.springframework.core.serializer.Serializer
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

1 个答案:

答案 0 :(得分:0)

无法明确找到对Spring 2.5的支持,但参考指南提到了Spring 2.5,所以我认为它支持它。

  

"主要区别在于上例中的地图键没有   需要引用Spring 2.5,但引号是强制性的   Spring 3.0。"