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

完整错误如下:

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相关推荐

  1. 项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved

    Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...

  2. import javax.servlet.ServletRequest 关于IDEA javax.servlet.http.HttpServletRequest 不存在 解决方案

    https://blog.csdn.net/a290450134/article/details/80964726 关于IDEA javax.servlet.http.HttpServletReque ...

  3. 报错: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 ...

  4. java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 的解决

    jetty 9 嵌入式开发时,启动正常,但是页面一浏览就报错如下: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest ...

  5. 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 ...

  6. 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 ...

  7. javax.servlet.http.HttpServletRequest错误

    javax.servlet.http.HttpServletRequest错误 javax这个api出错 问题分析:javax.api找不到. 解决方案: 方案一: 可以再maven的pom.xml文 ...

  8. Could not autowire field: private com.xxx.dao(已解决)

    最近刚在做一个关于o2o在线资源回收的一个项目,用到的框架就是SSM框架,可能有一段时间没有写代码了,一些常见的错误都折腾了半天,直接进入正题: 这个图片就是当时报错的图片. 当时是在控制器里注解接口 ...

  9. javax.servlet.http.HttpServletRequest接口(HTTP版本)

    < DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd> HttpServletR ...

最新文章

  1. Java 线程 笔记(1)
  2. [UI] 精美UI界面欣赏[1]
  3. Python入门100题 | 第054题
  4. Cookie和Session-学习笔记01【Cookie_快速入门、Cookie_细节】
  5. cd 地址 linux,Ubuntu10.10 CD/DVD下?地址+校??
  6. 读取STM32单片机-ID操作
  7. oracle错误:1067进程意外终止
  8. xss植入_网站xss漏洞的利用过程
  9. 【Python成长之路】来聊聊多线程的几位“辅助”
  10. 马云现身敦煌种梭梭树:蚂蚁森林即将突破1亿棵树
  11. CCF201409试题
  12. ASP.NET中的ExecuteNonQuery()方法的用法
  13. 2.微信小程序(colorUI)- 构建底部操作条
  14. 基于 GARCH-CoVaR 方法的中国 A 股行业 关联网络风险溢出动态研究
  15. 你的账户配置为阻止使用计算机,Win10打开软件提示为了对电脑进行保护,已经阻止此应用解决方法...
  16. java工程师青春饭吗_Java工程师是青春饭吗?
  17. 求助matlab崩溃问题的解决方案
  18. 我们距离构建一个逼真的虚拟世界还有多远
  19. 月薪40K起,什么是Python全栈工程师?全栈工程师薪资为何这么高?
  20. 内网环路怎么解决_利用生成树协议巧妙解决局域网二层环路

热门文章

  1. 《编码:隐匿在计算机软硬件背后的语言(美)》读书笔记一
  2. mybaits五:主键的自增
  3. 性能跟踪_ORACLE
  4. linux系统下搭建php环境之-Discuz论坛
  5. 仅IE6中链接A的href为javascript协议时不能在当前页面跳转
  6. Config Sharepoint 2013 Workflow PowerShell Cmdlet
  7. 社区奖品之DOULEX按键灯
  8. Java 打印菱形星块
  9. steam_api.dll文件
  10. python之字符串常用方法