Could not autowire when @Autowired. No beans of 'XXX' type found. Error Solution

Could not autowire Spring abnormalities occur during automatic injection. No beans of 'XXX' type found.

Method One : In the Mapper interface class
to add @Mapper while in the above plus a @Repository comment
stated Dao class Bean

Method two : the implementation class of Service
added @Autowired (required = false) behind @Autowired parameter
indicates ignore the current to be injected Bean, if there is a direct injection, without skipping.

Released three original articles · won praise 0 · Views 124

Guess you like

Origin blog.csdn.net/Pluto_sang/article/details/104697147