Failed to load ApplicationContext异常java.lang.NoSuchMethodError
来源:互联网 发布:淘宝买到三无产品 编辑:程序博客网 时间:2024/06/04 18:48
突然springmvc项目不能注入失败了。
java.lang.IllegalStateException: Failed to load ApplicationContext at (...此处忽略一些)Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDaoImpl': Injection of autowired dependencies failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.forAnnotations([Ljava/lang/annotation/Annotation;)Ljava/lang/reflect/AnnotatedElement; at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) at (...此处忽略一些)Caused by: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.forAnnotations([Ljava/lang/annotation/Annotation;)Ljava/lang/reflect/AnnotatedElement; at org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver.findValue(QualifierAnnotationAutowireCandidateResolver.java:346) at org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver.getSuggestedValue(QualifierAnnotationAutowireCandidateResolver.java:331) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1083) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:659) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ... 41 more
bug原因:
JUnit的包和Spring-test的版本冲突。
错误的依赖
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.2.6.RELEASE</version> <scope>test</scope> </dependency>
将spring-test的版本号换成4.1.6,就没有问题了
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.1.6.RELEASE</version> <scope>test</scope> </dependency>
阅读全文
0 0
- Failed to load ApplicationContext异常java.lang.NoSuchMethodError
- java.lang.IllegalStateException: Failed to load ApplicationContext异常解决方法
- java.lang.IllegalStateException: Failed to load ApplicationContext异常
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- Failed to load ApplicationContext java.lang.IllegalStateException:
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- java.lang.IllegalStateException: Failed to load ApplicationContext
- maven+spring测试出现 java.lang.IllegalStateException: Failed to load ApplicationContext异常
- java.lang.IllegalStateException: Failed to load ApplicationContext解决办法
- map(1)
- 如何利用消息系统避免分布式事务
- Almost Union-Find ()
- 输入框聚焦失焦时,标签隐藏与显示
- 0.3 CSDN Markdown简明教程3-表格和公式
- Failed to load ApplicationContext异常java.lang.NoSuchMethodError
- 把数组排成最小的数
- Ignatius and the Princess II
- SecureCRT自动登录
- 广度优先搜索
- 你知道这些和Linux有关的物流操作系统吗?
- 0.4 CSDN Markdown简明教程4-UML图
- C++学习日记18——C++继承: 公有public, 私有private, 保护protect
- 关于@Requestbody的注解