- 2019-02-14 Field xxx in xxx requ
- No such instance field: 'xxx
- The length of [xxx] field of [xx
- node 下 Unknown column 'xxx' in '
- jackson报错:Unrecognized field xxx
- android No static field XXX o
- Android No static field XXX of t
- Delphi Field XXX cannot be modif
- Signing for "xxx" requ
- 关闭 IDEA private field 'xxx' is n
使用springboot的测试类进行测试时遇到了错误:
Description:
Field analysisLibMgtService in com.yl.analysismgt.controller.AnalysisLibMgtController required a bean of type 'com.yl.analysismgt.service.AnalysisLibMgtService' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.yl.analysismgt.service.AnalysisLibMgtService' in your configuration.
错误原因:测试类中写成了@SpringBootTest(classes = AnalysisLibMgtController.class)
AnalysisLibMgtController非启动类,不能扫描到AnalysisLibMgtService。
改成//@SpringBootTest(classes = UapLabService.class)即可解决该问题。

网友评论