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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 记录第一次使用jni编译so包的入门操作
- 下一篇: RAC起单实例make