Cannot be obtained by calling springboot API?

for example, an interface interface A,
when called by other classes,

 @Resource
 private IMessageHandler imessageHandler;

use both Resource and Autowired to indicate that the bean cannot be found

Jun.10,2022

the reason is that the implementation class of the interface is not annotated with @ Component, so just add it.


you can also use @ Service

.
Menu