Could not autowire. No beans of 'DefaultCache' type found Reason for error

When creating a Springboot project, sometimes you will encounter the problem of no such bean, as shown in the figure.
no such bean object
At this time, you should check whether the package where this class is located is correct. It must be placed in the package or sub-package of the startup class.
Secondly, check whether this class is described using spring-specified annotations (such as @Component)

Guess you like

Origin blog.csdn.net/weixin_45015214/article/details/111830217