码迷,mamicode.com
首页 > 编程语言 > 详细

Could not autowire field: private javax.servlet.http.HttpServletRequest

时间:2017-12-07 21:19:04      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:efi   image   yun   expect   request   分享图片   log   with   ini   

在写单元测试类的时候,报错,废了很大劲才给调试好,给大家分享下。

技术分享图片

 

完整错误如下:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘buskjjlzjwyhpsController‘: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.servlet.http.HttpServletRequest com.yunhwa.business.controller.buskjjlzjwyhpsController.request; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 最后加入该注解完美解决

技术分享图片

 

Could not autowire field: private javax.servlet.http.HttpServletRequest

标签:efi   image   yun   expect   request   分享图片   log   with   ini   

原文地址:http://www.cnblogs.com/summary-2017/p/8000626.html

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 mamicode.com 版权所有 京ICP备13008772号-2
迷上了代码!