1.报错信息为:

Description:

Field userDao in com.XXX.XXX.service.impl.UserServiceImpl required a bean of type 'com.XXX.XXX.dao.UserDao' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.XXX.XXX.dao.UserDao' in your configuration.


Process finished with exit code 1

2.在启动类上加:

@ComponentScan(basePackages = {"com.XXX.XXX.dao"})

 

更多推荐

SpringCloud启动项目报错:Consider defining a bean of type 'com.XXX.XXX.dao.UserDao