java.lang.NoSuchMethodError: org.springframework.beans.BeanWrapper.setConversionService(Lorg/springframework/core/convert/ConversionService;)V

使用dubbo的时候报了错误。17:39:12.089 [main] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to&n...

使用dubbo的时候报了错误。

17:39:12.089 [main] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/D:/workspaces/myeclipse/gbpay-plat-v4/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-starter-web/1.5.9.RELEASE/spring-boot-starter-web-1.5.9.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter/1.5.9.RELEASE/spring-boot-starter-1.5.9.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot/1.5.9.RELEASE/spring-boot-1.5.9.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-logging/1.5.9.RELEASE/spring-boot-starter-logging-1.5.9.RELEASE.jar, file:/D:/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar, file:/D:/repository/org/hibernate/hibernate-validator/5.3.6.Final/hibernate-validator-5.3.6.Final.jar, file:/D:/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/D:/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/D:/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-databind/2.8.10/jackson-databind-2.8.10.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-core/2.8.10/jackson-core-2.8.10.jar, file:/D:/repository/org/springframework/spring-web/4.3.13.RELEASE/spring-web-4.3.13.RELEASE.jar, file:/D:/repository/org/springframework/spring-aop/4.3.13.RELEASE/spring-aop-4.3.13.RELEASE.jar, file:/D:/repository/org/springframework/spring-context/4.3.13.RELEASE/spring-context-4.3.13.RELEASE.jar, file:/D:/repository/org/springframework/spring-webmvc/4.3.13.RELEASE/spring-webmvc-4.3.13.RELEASE.jar, file:/D:/repository/org/springframework/spring-expression/4.3.13.RELEASE/spring-expression-4.3.13.RELEASE.jar, file:/D:/repository/com/alibaba/fastjson/1.2.4/fastjson-1.2.4.jar, file:/D:/repository/mysql/mysql-connector-java/5.1.40/mysql-connector-java-5.1.40.jar, file:/D:/repository/com/alibaba/druid-spring-boot-starter/1.1.2/druid-spring-boot-starter-1.1.2.jar, file:/D:/repository/com/alibaba/druid/1.1.2/druid-1.1.2.jar, file:/D:/Program%20Files/myeclipse/binary/com.sun.java.jdk8.win32.x86_64_1.8.0.v112/lib/jconsole.jar, file:/D:/Program%20Files/myeclipse/binary/com.sun.java.jdk8.win32.x86_64_1.8.0.v112/lib/tools.jar, file:/D:/repository/org/springframework/boot/spring-boot-autoconfigure/1.5.3.RELEASE/spring-boot-autoconfigure-1.5.3.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-jdbc/1.4.3.RELEASE/spring-boot-starter-jdbc-1.4.3.RELEASE.jar, file:/D:/repository/org/apache/tomcat/tomcat-jdbc/8.5.6/tomcat-jdbc-8.5.6.jar, file:/D:/repository/org/apache/tomcat/tomcat-juli/8.5.6/tomcat-juli-8.5.6.jar, file:/D:/repository/org/springframework/spring-jdbc/4.3.5.RELEASE/spring-jdbc-4.3.5.RELEASE.jar, file:/D:/repository/org/springframework/spring-tx/4.3.5.RELEASE/spring-tx-4.3.5.RELEASE.jar, file:/D:/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/repository/apache-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar, file:/D:/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar, file:/D:/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar, file:/D:/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar, file:/D:/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar, file:/D:/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar, file:/D:/repository/com/alipay/sdk/alipay-sdk-java/3.0.0/alipay-sdk-java-3.0.0.jar, file:/D:/repository/org/mybatis/generator/mybatis-generator-core/1.3.5/mybatis-generator-core-1.3.5.jar, file:/D:/repository/org/mybatis/generator/mybatis-generator-maven-plugin/1.3.5/mybatis-generator-maven-plugin-1.3.5.jar, file:/D:/repository/org/apache/maven/maven-plugin-api/3.3.9/maven-plugin-api-3.3.9.jar, file:/D:/repository/org/apache/maven/maven-model/3.3.9/maven-model-3.3.9.jar, file:/D:/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar, file:/D:/repository/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9.jar, file:/D:/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.2/org.eclipse.sisu.plexus-0.3.2.jar, file:/D:/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar, file:/D:/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar, file:/D:/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.2/org.eclipse.sisu.inject-0.3.2.jar, file:/D:/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar, file:/D:/repository/org/codehaus/plexus/plexus-classworlds/2.5.2/plexus-classworlds-2.5.2.jar, file:/D:/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-tomcat/2.0.0.M3/spring-boot-starter-tomcat-2.0.0.M3.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.16/tomcat-embed-core-8.5.16.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.16/tomcat-embed-el-8.5.16.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.16/tomcat-embed-websocket-8.5.16.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-jasper/9.0.0.M26/tomcat-embed-jasper-9.0.0.M26.jar, file:/D:/repository/org/eclipse/jdt/ecj/3.12.3/ecj-3.12.3.jar, file:/D:/repository/com/gb/soa/omp_cbaseinfo_api/1.0-SNAPSHOT/omp_cbaseinfo_api-1.0-SNAPSHOT.jar, file:/D:/repository/com/gb/soa/omp_ccommon_api/1.0-SNAPSHOT/omp_ccommon_api-1.0-SNAPSHOT.jar, file:/D:/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.7.3/jackson-module-jaxb-annotations-2.7.3.jar, file:/D:/repository/javax/el/javax.el-api/3.0.0/javax.el-api-3.0.0.jar, file:/D:/repository/com/gb/soa/SequenceClient/1.0-SNAPSHOT/SequenceClient-1.0-SNAPSHOT.jar, file:/D:/repository/org/slf4j/slf4j-api/1.7.22/slf4j-api-1.7.22.jar, file:/D:/repository/org/slf4j/log4j-over-slf4j/1.7.22/log4j-over-slf4j-1.7.22.jar, file:/D:/repository/org/slf4j/jcl-over-slf4j/1.7.22/jcl-over-slf4j-1.7.22.jar, file:/D:/repository/org/slf4j/jul-to-slf4j/1.7.22/jul-to-slf4j-1.7.22.jar, file:/D:/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar, file:/D:/repository/jline/jline/0.9.94/jline-0.9.94.jar, file:/D:/repository/io/netty/netty/3.7.0.Final/netty-3.7.0.Final.jar, file:/D:/repository/com/github/sgroschupf/zkclient/0.1/zkclient-0.1.jar, file:/D:/repository/ch/qos/logback/logback-classic/1.1.8/logback-classic-1.1.8.jar, file:/D:/repository/ch/qos/logback/logback-core/1.1.8/logback-core-1.1.8.jar, file:/D:/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar, file:/D:/repository/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar, file:/D:/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar, file:/D:/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar, file:/D:/repository/org/springframework/springloaded/1.2.7.RELEASE/springloaded-1.2.7.RELEASE.jar, file:/D:/repository/junit/junit/4.12/junit-4.12.jar, file:/D:/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-test/1.5.6.RELEASE/spring-boot-starter-test-1.5.6.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-test/1.5.6.RELEASE/spring-boot-test-1.5.6.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-test-autoconfigure/1.5.6.RELEASE/spring-boot-test-autoconfigure-1.5.6.RELEASE.jar, file:/D:/repository/com/jayway/jsonpath/json-path/2.2.0/json-path-2.2.0.jar, file:/D:/repository/net/minidev/json-smart/2.2.1/json-smart-2.2.1.jar, file:/D:/repository/net/minidev/accessors-smart/1.1/accessors-smart-1.1.jar, file:/D:/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar, file:/D:/repository/org/assertj/assertj-core/2.6.0/assertj-core-2.6.0.jar, file:/D:/repository/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar, file:/D:/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar, file:/D:/repository/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar, file:/D:/repository/org/skyscreamer/jsonassert/1.4.0/jsonassert-1.4.0.jar, file:/D:/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar, file:/D:/repository/org/springframework/spring-core/4.3.10.RELEASE/spring-core-4.3.10.RELEASE.jar, file:/D:/repository/org/springframework/spring-test/4.3.10.RELEASE/spring-test-4.3.10.RELEASE.jar, file:/D:/repository/commons-io/commons-io/2.2/commons-io-2.2.jar, file:/D:/repository/com/alibaba/dubbo/2.5.3/dubbo-2.5.3.jar, file:/D:/repository/org/springframework/spring/2.5.6.SEC03/spring-2.5.6.SEC03.jar, file:/D:/repository/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.jar, file:/D:/repository/org/jboss/netty/netty/3.2.5.Final/netty-3.2.5.Final.jar, file:/D:/repository/com/101tec/zkclient/0.10/zkclient-0.10.jar, file:/D:/repository/org/springframework/spring-beans/4.3.7.RELEASE/spring-beans-4.3.7.RELEASE.jar]
17:39:12.099 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
java.lang.NoSuchMethodError: org.springframework.beans.BeanWrapper.setConversionService(Lorg/springframework/core/convert/ConversionService;)V
	at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:147)
	at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
	at org.springframework.validation.DataBinder.bind(DataBinder.java:740)
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.bindSpringProfiles(ConfigFileApplicationListener.java:548)
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.initializeActiveProfiles(ConfigFileApplicationListener.java:403)
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:360)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:225)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:195)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
	at start.Start.main(Start.java:16)

一般报这个异常是因为spring的jar冲突,但是怎么看都没找到问题。

最终通过排查法找到了办法。

将:

<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>dubbo</artifactId>
	<version>2.5.3</version>
</dependency>

改成:

<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>dubbo</artifactId>
	<version>2.5.3</version>
	<exclusions>
		<exclusion>
			<groupId>org.springframework</groupId>
			<artifactId>spring</artifactId>
		</exclusion>
	</exclusions>
</dependency>

就解决了

条评论

请先 登录 后评论
不写代码的码农
三叔

422 篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除