setSerializationId没有这样的方法错误 [英] setSerializationId no such method error
问题描述
我正在尝试运行我的项目,但每次都会遇到此错误:
Im trying to run my project, but this error hits me everytime:
org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.setSerializationId(Ljava/lang/String;)V
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
这是我的春季申请上下文:
This is my spring application context:
是什么导致这种情况?任何帮助将不胜感激。
What can cause this? Any help would be appreciated.
提前致谢。
推荐答案
从$ 3.0开始, setSerializationId
方法存在于 DefaultListableBeanFactory
类中,但不在春季2.5的同一类中。我认为你正在使用两种版本的弹簧混合。看来你正在使用一个依赖于旧版spring的库,例如spring-web。我建议你检查你的类路径中的所有罐子。
The setSerializationId
method is present in DefaultListableBeanFactory
class from spring 3.0 but not in the same class from spring 2.5. I think you're working with a mixdown of the two versions of spring. It seems that you are using a library which depends on the old version of spring, for instance maybe spring-web. I suggest you to check all the jars in your classpath.
这篇关于setSerializationId没有这样的方法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!