我创建了一个 Spring webapp,该应用程序在 tomcat 和 CloudFoundry 上运行,但尝试在 JBoss(OpenShift express)上启动应用程序时出现错误。
开始时出现以下错误:
2012/04/10 11:11:58,967 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Context initialization failed: org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [org.springframework.web.context.support.XmlWebApplicationContext]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError:
org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/Converter;)V
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_22]
Caused by: java.lang.NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/Converter;)V
at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:62) [org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:53) [org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:42) [org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
... 12 more
我认为这是一个 JAR 冲突/重复,并去检查 maven 设置是否存在依赖冲突,但是,在检查了 Eclipse Maven 依赖层次结构中的传递依赖之后,我明确排除了除 3.1.1 之外的所有版本(有问题的这个类是我相信是在 v3.0 中引入的)-Spring-core
和org.springframework.core
)
有人知道我可能会错过什么吗?