admin管理员组文章数量:1025202
启动 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);
}
}
启动 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
版权声明:本文标题:Java--Action: Consider defining a bean of type ‘com.XX.dao.XXDao‘ in your configuration 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1738336788a1562843.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论