Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将Spring应用部署到JBoss时出错-NoSuchMethodError_Java_Spring_Maven_Dependencies - Fatal编程技术网

Java 将Spring应用部署到JBoss时出错-NoSuchMethodError

Java 将Spring应用部署到JBoss时出错-NoSuchMethodError,java,spring,maven,dependencies,Java,Spring,Maven,Dependencies,我已经创建了一个SpringWebApp,该应用程序正在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.springf

我已经创建了一个SpringWebApp,该应用程序正在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
2012/04/10 11:11:58967错误[org.springframework.web.context.ContextLoader](MSC服务线程1-1)上下文初始化失败:org.springframework.beans.beans实例化异常:
无法实例化bean类[org.springframework.web.context.support.XmlWebApplicationContext]:构造函数引发异常;嵌套异常为java.lang.NoSuchMethodError:
org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/converter;)V
在org.springframework.beans.BeanUtils.instanceClass(BeanUtils.java:162)[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
在org.springframework.beans.BeanUtils.instanceClass(BeanUtils.java:104)[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
在java.lang.Thread.run(Thread.java:679)[rt.jar:1.6.0_22]
原因:java.lang.NoSuchMethodError:org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/converter;)V
位于org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:62)[org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
位于org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:53)[org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
位于org.springframework.core.convert.support.DefaultConversionService.(DefaultConversionService.java:42)[org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
... 还有12个
我假设这是一个JAR冲突/重复应用程序,并检查了maven设置中的依赖冲突,然而,在检查了EclipseMaven依赖继承权中的可传递依赖关系之后,我明确地列出了除3.1.1之外的所有版本(我相信这个类是在v3.0中引入的)-即
springcore
org.springframework.core


有人知道我可能遗漏了什么吗?

好的,我发现了这个问题

在Eclipse中使用M2EclipseMaven插件时,我排除了
SpringCore
依赖项(这将库从每个依赖项中排除,因为它是一个可传递的依赖项),我认为这是可以的,因为我使用的是
org.springframework.core

然而,看起来它只是将它们从第一级可传递依赖项中排除,在我构建的WAR文件中,它仍然在向下拉
SpringCore.3.0.3
(我以前没有这样做过,因为我正在部署Redhat的OpenShift平台,设置东西需要一些工作,以便我可以将scp发送到服务器以获得构建的war)

我现在通过明确声明对spring core.3.1.1的依赖关系并排除所有其他依赖关系来解决这个问题,以确保最新版本被删除


我想寓意是不要相信M2Eclipse插件中的“已解决的依赖项”视图可以查看正在使用的库。

好的,我发现了这个问题

在Eclipse中使用M2EclipseMaven插件时,我排除了
SpringCore
依赖项(这将库从每个依赖项中排除,因为它是一个可传递的依赖项),我认为这是可以的,因为我使用的是
org.springframework.core

然而,看起来它只是将它们从第一级可传递依赖项中排除,在我构建的WAR文件中,它仍然在向下拉
SpringCore.3.0.3
(我以前没有这样做过,因为我正在部署Redhat的OpenShift平台,设置东西需要一些工作,以便我可以将scp发送到服务器以获得构建的war)

我现在通过明确声明对spring core.3.1.1的依赖关系并排除所有其他依赖关系来解决这个问题,以确保最新版本被删除

我想寓意是不要相信M2Eclipse插件中的“已解决的依赖项”视图用于所使用的LIB视图