springboot 报错Field XXX required a bean of type XXX that could not be found.

例如:

Description:

Field menuService in com.goodidea.sso.controller.MenuController required a bean of type 'com.goodidea.sso.service.MenuService' that could not be found.


Action:

Consider defining a bean of type 'com.goodidea.sso.service.MenuService' in your configuration.

在代码service上缺少相应的注解,像这样补充完注解即可

@Service
public class MenuServiceImpl implements MenuService 

你可能感兴趣的:(难点和错误)