Could not autowire field: private javax.servlet.http.HttpServletRequest
在写单元测试类的时候,报错,废了很大劲才给调试好,给大家分享下。
完整错误如下:
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)}
最后加入该注解完美解决
转载于:https://www.cnblogs.com/summary-2017/p/8000626.html
Could not autowire field: private javax.servlet.http.HttpServletRequest相关推荐
- 项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved
Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...
- import javax.servlet.ServletRequest 关于IDEA javax.servlet.http.HttpServletRequest 不存在 解决方案
https://blog.csdn.net/a290450134/article/details/80964726 关于IDEA javax.servlet.http.HttpServletReque ...
- 报错:The type javax.servlet.http.HttpServletRequest cannot be resolved
[0]README 0.1)以下内容转自: http://blog.csdn.net/vincent080928/article/details/5392891 problem)The type ja ...
- java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 的解决
jetty 9 嵌入式开发时,启动正常,但是页面一浏览就报错如下: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest ...
- The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced fro
今天将一个web项目导入Eclipse的时候,项目报错如下: The type javax.servlet.http.HttpServletRequest cannot be resolved. It ...
- The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from
The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from ...
- javax.servlet.http.HttpServletRequest错误
javax.servlet.http.HttpServletRequest错误 javax这个api出错 问题分析:javax.api找不到. 解决方案: 方案一: 可以再maven的pom.xml文 ...
- Could not autowire field: private com.xxx.dao(已解决)
最近刚在做一个关于o2o在线资源回收的一个项目,用到的框架就是SSM框架,可能有一段时间没有写代码了,一些常见的错误都折腾了半天,直接进入正题: 这个图片就是当时报错的图片. 当时是在控制器里注解接口 ...
- javax.servlet.http.HttpServletRequest接口(HTTP版本)
< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd> HttpServletR ...
最新文章
- Java 线程 笔记(1)
- [UI] 精美UI界面欣赏[1]
- Python入门100题 | 第054题
- Cookie和Session-学习笔记01【Cookie_快速入门、Cookie_细节】
- cd 地址 linux,Ubuntu10.10 CD/DVD下?地址+校??
- 读取STM32单片机-ID操作
- oracle错误:1067进程意外终止
- xss植入_网站xss漏洞的利用过程
- 【Python成长之路】来聊聊多线程的几位“辅助”
- 马云现身敦煌种梭梭树:蚂蚁森林即将突破1亿棵树
- CCF201409试题
- ASP.NET中的ExecuteNonQuery()方法的用法
- 2.微信小程序(colorUI)- 构建底部操作条
- 基于 GARCH-CoVaR 方法的中国 A 股行业 关联网络风险溢出动态研究
- 你的账户配置为阻止使用计算机,Win10打开软件提示为了对电脑进行保护,已经阻止此应用解决方法...
- java工程师青春饭吗_Java工程师是青春饭吗?
- 求助matlab崩溃问题的解决方案
- 我们距离构建一个逼真的虚拟世界还有多远
- 月薪40K起,什么是Python全栈工程师?全栈工程师薪资为何这么高?
- 内网环路怎么解决_利用生成树协议巧妙解决局域网二层环路