首页 > 编程语言 > 详细

spring测试出错:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0':

时间:2019-12-08 15:51:23      阅读:942      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

解决办法

这里找不到根路径,也就找不到Spring-config.xml的配置,所以加上更改根路径的注解@WebAppConfiguration(“src/main/resources”)就解决了

 

1 @RunWith(SpringJUnit4ClassRunner.class)
2 @WebAppConfiguration("src/main/resources")  //加上这个注解完美解决
3 @ContextConfiguration(locations = {"classpath:spring-persist-mybatis.xml","classpath:spring-persist-tx.xml", "classpath:springmvc.xml"})
4 public class CrowdFundingText {

 

spring测试出错:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0':

原文:https://www.cnblogs.com/zwq20134/p/12005688.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!