解决一次依赖冲突

问题 专栏收录该内容
82 篇文章 0 订阅

项目无法启动,通过错误提示应该是spring jar包以来冲突导致的:

 

java.lang.NoSuchMethodError: org.springframework.beans.BeanUtils.instantiateClass(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/Object;
	at org.springframework.test.context.ContextLoaderUtils.resolveContextLoader(ContextLoaderUtils.java:87)
	at org.springframework.test.context.ContextLoaderUtils.buildMergedContextConfiguration(ContextLoaderUtils.java:298)
	at org.springframework.test.context.TestContext.<init>(TestContext.java:100)
	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:117)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:119)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:108)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

 

 

通过mvn dependency:tree 查看果然存在两个版本的spring依赖冲突

 

[INFO] com.duitang:cobweb:war:1.0-SNAPSHOT
[INFO] +- com.duitang.dboss:dboss-client:jar:0.0.1-SNAPSHOT:compile
[INFO] | +- com.alibaba:dubbo:jar:2.5.3:compile
[INFO] | | +- org.springframework:spring:jar:2.5.6.SEC03:compile
[INFO] | | +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] | | \- org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] | +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | \- com.duitang.dboss:dboss:jar:0.0.1-SNAPSHOT:compile
[INFO] +- com.duitang:tower:jar:1.0-SNAPSHOT:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- commons-codec:commons-codec:jar:1.4:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] +- org.freemarker:freemarker:jar:2.3.19:compile
[INFO] +- junit:junit:jar:4.10:test (scope not updated to compile)
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | \- org.mortbay.jetty:servlet-api:jar:2.5-20081211:compile
[INFO] +- org.mortbay.jetty:start:jar:6.1.26:compile
[INFO] +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] +- org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.26:compile
[INFO] | +- org.eclipse.jdt:core:jar:3.1.1:compile
[INFO] | +- org.mortbay.jetty:jsp-api-2.1-glassfish:jar:2.1.v20091210:compile
[INFO] | +- org.mortbay.jetty:jsp-2.1-glassfish:jar:2.1.v20091210:compile
[INFO] | | \- org.eclipse.jdt.core.compiler:ecj:jar:3.5.1:compile
[INFO] | \- ant:ant:jar:1.6.5:compile
[INFO] +- org.springframework:spring-core:jar:3.1.2.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:3.1.2.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-context:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.1.2.RELEASE:compile
[INFO] | \- org.springframework:spring-context-support:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.1.2.RELEASE:test
[INFO] +- org.springframework:spring-orm:jar:3.1.2.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-openid:jar:3.1.1.RELEASE:compile
[INFO] | +- com.google.inject:guice:jar:2.0:compile
[INFO] | \- org.openid4java:openid4java-nodeps:jar:0.9.6:compile
[INFO] | \- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.1.1.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:3.1.1.RELEASE:compile
[INFO] +- redis.clients:jedis:jar:2.1.0:compile
[INFO] +- org.springframework.data:spring-data-redis:jar:1.0.1.RELEASE:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.8:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.8:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- com.duitang.external:spring-test-mvc:jar:1.0.0:test
[INFO] +- net.sf.uadetector:uadetector-resources:jar:2012.08:compile
[INFO] | \- net.sf.uadetector:uadetector-core:jar:0.5.0:compile
[INFO] +- com.googlecode.rapid-framework:rapid-core:jar:4.0.5:compile
[INFO] | +- javax.activation:activation:jar:1.1.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.3.1:compile
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] | | +- asm:asm:jar:3.3:compile
[INFO] | | +- org.apache.cxf:cxf-api:jar:2.3.1:compile
[INFO] | | | +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.7:compile
[INFO] | | | +- org.apache.neethi:neethi:jar:2.0.4:compile
[INFO] | | | | \- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] | | | \- org.apache.cxf:cxf-common-schemas:jar:2.3.1:compile
[INFO] | | +- org.apache.cxf:cxf-rt-core:jar:2.3.1:compile
[INFO] | | | +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
[INFO] | | | \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.3.1:compile
[INFO] | | | +- org.apache.cxf:cxf-tools-common:jar:2.3.1:compile
[INFO] | | | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.3.1:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.3.1:compile
[INFO] | | +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.3.1:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-addr:jar:2.3.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-transports-http:jar:2.3.1:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-security:jar:2.3.1:compile
[INFO] | +- org.apache.cxf:cxf-common-utilities:jar:2.3.1:compile
[INFO] | | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.0.8:runtime
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.0.2:runtime
[INFO] | +- org.apache.ws.security:wss4j:jar:1.5.10:compile
[INFO] | | \- org.apache.santuario:xmlsec:jar:1.4.4:compile
[INFO] | +- xalan:xalan:jar:2.7.1:compile
[INFO] | | \- xalan:serializer:jar:2.7.1:compile
[INFO] | \- org.bouncycastle:bcprov-jdk15:jar:1.45:runtime
[INFO] +- org.apache.mahout:mahout-math:jar:0.7:compile
[INFO] | +- org.apache.commons:commons-math:jar:2.2:compile
[INFO] | \- org.uncommons.maths:uncommons-maths:jar:1.2.2:compile
[INFO] | \- jfree:jcommon:jar:1.0.12:compile
[INFO] +- org.apache.mahout:mahout-integration:jar:0.7:compile
[INFO] | +- org.apache.solr:solr-commons-csv:jar:3.5.0:compile
[INFO] | +- org.apache.lucene:lucene-benchmark:jar:3.6.0:compile
[INFO] | | +- org.apache.lucene:lucene-highlighter:jar:3.6.0:compile
[INFO] | | | \- org.apache.lucene:lucene-queries:jar:3.6.0:compile
[INFO] | | | \- jakarta-regexp:jakarta-regexp:jar:1.4:compile
[INFO] | | +- org.apache.lucene:lucene-memory:jar:3.6.0:compile
[INFO] | | +- org.apache.lucene:lucene-facet:jar:3.6.0:compile
[INFO] | | +- com.ibm.icu:icu4j:jar:4.8.1.1:compile
[INFO] | | +- org.apache.commons:commons-compress:jar:1.2:compile
[INFO] | | \- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | +- org.apache.lucene:lucene-analyzers:jar:3.6.0:compile
[INFO] | +- org.mongodb:mongo-java-driver:jar:2.5:compile
[INFO] | +- org.mongodb:bson:jar:2.5:compile
[INFO] | +- org.apache.cassandra:cassandra-all:jar:0.8.1:compile
[INFO] | | +- commons-cli:commons-cli:jar:1.1:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | | +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.1:compile
[INFO] | | +- org.antlr:antlr:jar:3.2:compile
[INFO] | | | \- org.antlr:antlr-runtime:jar:3.2:compile
[INFO] | | | \- org.antlr:stringtemplate:jar:3.2:compile
[INFO] | | | \- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.apache.cassandra.deps:avro:jar:1.4.0-cassandra-1:compile
[INFO] | | +- jline:jline:jar:0.9.94:compile
[INFO] | | +- com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO] | | +- com.github.stephenc.high-scale-lib:high-scale-lib:jar:1.1.2:compile
[INFO] | | +- org.yaml:snakeyaml:jar:1.6:compile
[INFO] | | +- org.apache.thrift:libthrift:jar:0.6.1:compile
[INFO] | | | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | | | \- org.apache.httpcomponents:httpclient:jar:4.1.1:compile
[INFO] | | | \- org.apache.httpcomponents:httpcore:jar:4.0.1:compile
[INFO] | | +- org.apache.cassandra:cassandra-thrift:jar:0.8.1:compile
[INFO] | | \- com.github.stephenc:jamm:jar:0.2.2:compile
[INFO] | \- me.prettyprint:hector-core:jar:0.8.0-2:compile
[INFO] | +- org.slf4j:jul-to-slf4j:jar:1.6.1:compile
[INFO] | +- com.github.stephenc.eaio-uuid:uuid:jar:3.2.0:compile
[INFO] | \- com.ecyrd.speed4j:speed4j:jar:0.9:compile
[INFO] +- org.apache.mahout:mahout-core:jar:0.7:compile
[INFO] | +- com.thoughtworks.xstream:xstream:jar:1.3.1:compile
[INFO] | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:3.6.0:compile
[INFO] | +- org.apache.mahout.commons:commons-cli:jar:2.0-mahout:compile
[INFO] | \- org.apache.hadoop:hadoop-core:jar:0.20.204.0:compile
[INFO] | +- commons-httpclient:commons-httpclient:jar:3.0.1:compile
[INFO] | \- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] +- org.apache.mahout:mahout-collections:jar:1.0:compile
[INFO] +- org.apache.mahout:mahout-utils:jar:0.5:compile
[INFO] | \- org.slf4j:slf4j-jcl:jar:1.6.0:compile
[INFO] +- org.iq80.leveldb:leveldb:jar:0.5:compile
[INFO] | \- org.iq80.leveldb:leveldb-api:jar:0.5:compile
[INFO] +- com.google.guava:guava:jar:14.0.1:compile
[INFO] +- org.jfree:jfreechart:jar:1.0.14:compile
[INFO] | +- org.jfree:jcommon:jar:1.0.17:compile
[INFO] | +- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | \- com.lowagie:itext:jar:2.1.5:compile
[INFO] | +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO] | \- bouncycastle:bcprov-jdk14:jar:138:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.1.2.RELEASE:compile
[INFO] +- org.apache.ibatis:ibatis-sqlmap:jar:2.3.4.726:compile
[INFO] \- mysql:mysql-connector-java:jar:5.1.21:compile

 

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

参与评论 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页

打赏作者

SAN_YUN

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值