Springboot整合注解和xml出现的错误

Field accountDao in com.mdxl.service.AccountService required a bean of type 'com.mdxl.dao.MbAccountD

详细看下面

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

Description:

Field accountDao in com.mdxl.service.AccountService required a bean of type 'com.mdxl.dao.MbAccountDao' that could not be found.


Action:

Consider defining a bean of type 'com.mdxl.dao.MbAccountDao' in your configuration

 

网上找了好多,都说少注解什么的,我这个是因为这个

Field accountDao in com.mdxl.service.AccountService required a bean of type 'com.mdxl.dao.MbAccountD

@MapperScan(basePackages="com.mdxl.mapper")

正确的是:@MapperScan(basePackages="com.mdxl"),有的interface和mapper扫描不到会报错

 

转载于:https://my.oschina.net/mdxlcj/blog/1536123

相关文章: