admin管理员组

文章数量:1531284

启动 SpringBoot项目报错:

***************************
APPLICATION FAILED TO START
***************************

Description:

Field adminRoleRelationDao in com.macro.mall.tiny.service.impl.UmsAdminServiceImpl required a bean of type 'com.macro.mall.tiny.dao.UmsAdminRoleRelationDao' 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.macro.mall.tiny.dao.UmsAdminRoleRelationDao' in your configuration.

报错原因:

项目未扫描到 dao 包

解决办法:

在主启动类上加上:@ComponentScan(basePackages = {“com.XX.dao”}) 你的项目的dao层包路径,如下:

@ComponentScan(basePackages = {"com.xx.dao"})//引入dao根路径
//@MapperScan("com.macro.mall.tiny.mbg.mapper")
@SpringBootApplication
public class MallApplication {
    public static void main(String[] args) {
        SpringApplication.run(MallApplication.class, args);
    }
}

 

本文标签: definingbeanJavaActiontype