Java--use @Autowired to report an error Could not autowire. No beans of 'XX' type found.

The error reported when using @Autowired is as follows:

Could not autowire. No beans of 'XXXX' type found. 

 1. Check the path of the imported object class; when injecting, the path of the imported object class is incorrect; or sometimes there is a class with the same name, which will cause an error

2. What is often encountered is that the automatic detection level of @Autowired is too high, you can use the following method, or change the Error level to prompt or warning
insert image description here

Guess you like

Origin blog.csdn.net/MinggeQingchun/article/details/118583894#comments_27930618