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

完整错误如下:

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的更多相关文章

  1. Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.******.seashell.bpc.query.query.service.FscBankPayCodeQueryService

    2019-03-19 16:22:14,945 WARN [main] (org.springframework.context.support.AbstractApplicationContext. ...

  2. Java-API:javax.servlet.http.HttpServletRequest

    ylbtech-Java-API:javax.servlet.http.HttpServletRequest 1.返回顶部 1. javax.servlet.http Interface HttpSe ...

  3. Java-Class-I:javax.servlet.http.HttpServletRequest

    ylbtech-Java-Class-I:javax.servlet.http.HttpServletRequest 1.返回顶部   2.返回顶部 1. package com.ylbtech.ap ...

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

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

  5. 无法解析类型 javax.servlet.http.HttpServletRequest。从必需的 .class 文件间接引用

    java.lang.Error: 无法解析的编译问题: 无法解析类型 javax.servlet.http.HttpServletRequest.从必需的 .class 文件间接引用了它 无法解析类型 ...

  6. The import javax.servlet.http.HttpServletRequest cannot be resolved

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

  7. 在Myeclipse buildpath 加server lib (server runtime)/项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved

    来源于:http://blog.csdn.net/dingqinghu/article/details/8805922 http://yl-fighting.iteye.com/blog/140946 ...

  8. The type javax.servlet.http.HttpServletRequest cannot be resolved.

    The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from ...

  9. javax.servlet.http.HttpServletRequest;

    错误提示是没有引入javax.servlet.http.HttpServletRequest所在的包,编译错误. 这么添加: 项目-->右键-->properties-->java ...

随机推荐

  1. android自定义View_3——Optimizing the View

    前言:现在你已经有了一个自定义的view了,并且支持手势和过度动画等属性,现在你要确认这个view 有够快的速度,为了使其在UI上不会显得迟钝或是卡停,你要保证view动画,能每秒最好有60帧. 一: ...

  2. final和finally面试时最好的回答

    finally: try块必须和catch块或和finally同在,不能单独存在,二者必须出现一个. finally块总会执行,不论是否有错误出现.但是若try语句块或会执行的catch语句块使用了J ...

  3. 2、ACE-实用生活口语-介绍 Introductions

    (1) (2) (3)认识你很荣幸,如何称呼您呢?It's a pleasure to meet you.I'm glad to meet you.May I have your name?How s ...

  4. 《从零开始学Swift》学习笔记(Day 14)——字符串的插入、删除和替换

    原创文章,欢迎转载.转载请注明:关东升的博客 对应可变字符串可以插入.删除和替换,String提供了几个方法可以帮助实现这些操作.这些方法如下: splice(_:atIndex:).在索引位置插入字 ...

  5. B - Catch That Cow (抓牛)

    B - Catch That Cow Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u ...

  6. virgo使用指南

    一.说明: 一个windows虚拟桌面软件,很小,不到10K,占用内存也极小.超级方便. 二.GitHub地址: henkman/virgo: Virtual desktops for Windows ...

  7. SharePoint服务器端对象模型 之 访问网站和列表数据(Part 2)

    (二)列表(SPList) 列表是SharePoint中最为重要的数据容器,我们一般保存在SharePoint中的所有数据,都是保存在列表中(文档库也是一种列表),因此列表对象在SharePoint的 ...

  8. CSS如何清除浮动流的多种方案

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. 《UNIX网络编程》 -- 第五章

    str_cli 和 str_echo 函数 需要先弄清楚 3.9 readn.writen 和 readline 函数 str_cli void str_cli(FILE *fp, int sockf ...

  10. GPU instancing

    参考 https://www.cnblogs.com/hont/p/7143626.html github地址 https://github.com/yingsz/instancing/ 补充2点: ...