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

完整错误如下:

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. C++调用Fortran程序----动态链接方式

    参考http://yxbwuhee.blog.sohu.com/143577510.html 一.C++动态调用Fortran DLL (1)创建FORTRAN DLL工程,生成forsubs.dll ...

  2. android Material design是什么

    Material design概述: Material design是一套UI样式标准,应该会提供一些新的API这写API包含了以下五大模块内容,分别是: Material Theme New Wid ...

  3. hdu 4705(树形DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4705 思路:反面考虑,用总的方案数减去A,B,C三点在同一路径上的方案数.于是我们可以确定中间点B,在 ...

  4. cocos2d-x - android 学习(集成NDK、配置开发环境)

    先来贴上一大神的博客:日月之明 --- http://www.cnblogs.com/lhming/tag/cocs2d-x/ 需要工具和软件包:Eclipse.Android SDK.Android ...

  5. Windows中安装Scrapy

    在linux中安装Scrapy只需要导入一些非python的支持包,在windows中安装Scrapy则是一波三折. 总之来说,主要分为以下几个步骤,可能由于系统问题(国内个人机子,甚至是小企业的机子 ...

  6. EasyUI 相关

    根据关键字值取行 var rowIndex = $('#tt').datagrid('getRowIndex', id);//id是关键字值 var data = $('#tt').datagrid( ...

  7. zookeeper 命令行使用

    先用简易的客户端链接上 默认链接的就是本机上面的zkserver 我一上来help 下.没办法 ,用的少,先喊一声救命 ,看看有没有人救我! [zk: localhost:2181(CONNECTED ...

  8. RTLabel 富文本

    本节关于RTLable基本介绍,原文来自 https://github.com/honcheng/RTLabel RTLabel 基于富文本的格式,适用于iOS,类似HTML的标记. RTLabel ...

  9. php自定义函数: 时间转换成智能形式

    function time_trans($paratime,$suffix=false){ $now_time = time(); $dur = $now_time - $paratime; $suf ...

  10. 找出n的阶乘末尾有几个零

    原理:因为10由2*5组成,而构成2的因数比5多 所以最终转换成求5的个数 int getNumber(int n) { int count = 0; while(n) { n = n/5; coun ...