最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Consider defining a bean of type ‘com.my.bbs.dao.BBSUserMapper‘ in your configuration.

运维笔记admin3浏览0评论

启动时IDEA控制台报错:

APPLICATION FAILED TO START
***************************
 
Description:
 
Field sysUserDao in com.iamapsycho.service.impl.SysUserServiceImpl required a bean of type 'com.iamapsycho.dao.SysUserDao' that could not be found.
 
 
Action:
 
 Consider defining a bean of type 'com.my.bbs.dao.BBSUserMapper' in your configuration.

错误的大概意思就是:

这个错误提示是因为在com.my.bbs.service.impl.BBSUserServiceImpl类中需要一个类型为com.my.bbs.dao.BBSUserMapper的bean,但是在Spring的配置中没有找到。

最简单的解决方案:

启动类上添加:@MapperScan(“对应代理类的包名”)【中间具体的填写什么内容,主要看你mapper层包名】

@MapperScan("com.my.bbs.dao")

重新启动程序!

解决完事!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论