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)}
最后加入该注解完美解决
Could not autowire field: private javax.servlet.http.HttpServletRequest的更多相关文章
- 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. ...
- Java-API:javax.servlet.http.HttpServletRequest
ylbtech-Java-API:javax.servlet.http.HttpServletRequest 1.返回顶部 1. javax.servlet.http Interface HttpSe ...
- Java-Class-I:javax.servlet.http.HttpServletRequest
ylbtech-Java-Class-I:javax.servlet.http.HttpServletRequest 1.返回顶部 2.返回顶部 1. package com.ylbtech.ap ...
- java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 的解决
jetty 9 嵌入式开发时,启动正常,但是页面一浏览就报错如下: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest ...
- 无法解析类型 javax.servlet.http.HttpServletRequest。从必需的 .class 文件间接引用
java.lang.Error: 无法解析的编译问题: 无法解析类型 javax.servlet.http.HttpServletRequest.从必需的 .class 文件间接引用了它 无法解析类型 ...
- The import javax.servlet.http.HttpServletRequest cannot be resolved
Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...
- 在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 ...
- The type javax.servlet.http.HttpServletRequest cannot be resolved.
The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from ...
- javax.servlet.http.HttpServletRequest;
错误提示是没有引入javax.servlet.http.HttpServletRequest所在的包,编译错误. 这么添加: 项目-->右键-->properties-->java ...
随机推荐
- 嵌入式开发之davinci--- 8148/8168/8127 中swms、Mosaic’s、display 显示pal 模式
(1) (2) (3) (4) -------------------------author:pkf ------------------------------time:2-3 --------- ...
- arm-linux字符设备驱动开发之---简单字符设备驱动
一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 1.字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据,读取数据需要按照先后数据.字符设备是面 ...
- tinyint(4),tinyint(80)有什么区别
tinyint格式: TINYINT[(M)] [UNSIGNED] [ZEROFILL] M默认为4 Tinyint占用1字节的存储空间,即8位(bit). 带符号的范围是-128到127.无符号的 ...
- unintest基础1
import unittest class Testfunc(unittest.TestCase): def testfunc(self): print('testfunc1') def testfu ...
- BUFSIZ解析
BUFSIZ解析: 包含在#include<stdio.h>中,BUFSIZ[=8192]. stdio.h:#ifndef BUFSIZ stdio.h:#define BUFSIZ _ ...
- ofstream和ifstream详细用法
ASCII和二进制文件的输入输出 First:包含头文件#include <fstream> ASCII输入: 首先要创建一个in-stream对象:ifstream fin(" ...
- codevs 必做:堆:1245、2879 并查集:1069、1074、1073
1245 最小的N个和 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题解 查看运行结果 题目描述 Description 有两个长度为 N ...
- Partial Sum
Partial Sum Accepted : 80 Submit : 353 Time Limit : 3000 MS Memory Limit : 65536 KB Partial Sum ...
- python系列一:python3基础语法
'''python保留字即关键字,我们不能把它们用作任何标识符名称.Python 的标准库提供了一个 keyword 模块,可以输出当前版本的所有关键字: '''>>> import ...
- 如何使用模板生成 sqlite3 sql 创建语句?
template<typename T,typename... Args> std::string createTable(T tableName,Args&&... ar ...