当前位置: 首页 > Java > 正文

java.lang.NoSuchMethodError

关键字:
1 星2 星3 星4 星5 星 (暂无评分)
Loading ... Loading ...
baidu_share
Caused by: java.lang.NoSuchMethodError: org.springframework.context.ApplicationContext.getBean(Ljava/lang/Class;)Ljava/lang/Object;
	at com.jd.xq.ApplicationContextUtil.getBean(ApplicationContextUtil.java:23)
	at com.jd.xq.DynamicUpdateSpringBeanAttr.start(DynamicUpdateSpringBeanAttr.java:19)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
	... 30 more
2015-11-9 17:40:47 org.apache.catalina.core.StandardContext start

问题原因:由于spring包冲突造成的
依赖spring-3.1.2和spring-2.5.6,包2.5.6去掉,问题解决。

<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-context</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-core</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-bean</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring</artifactId>
				</exclusion>
 
			</exclusions>

本文固定链接: http://www.chepoo.com/java-lang-no-such-method-error.html | IT技术精华网

【上一篇】
【下一篇】

java.lang.NoSuchMethodError:等您坐沙发呢!

发表评论