您当前的位置: 首页 >  ui

培根芝士

暂无认证

  • 5浏览

    0关注

    446博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Mybatis与springboot项目启动时出现Field mapper in ‘xxx‘ required a bean of type ‘xxx‘ that could not be found

培根芝士 发布时间:2020-11-13 18:57:54 ,浏览量:5

Mybatis与springboot项目,启动时报错,详细的错误如下:

Field mapper in 'xxx' required a bean of type 'xxx' that could not be found. Action: Consider defining a bean of type ‘xxx’ in your configuration.

原因是bean装配失败,springboot扫描时没有找到@Mapper对应的接口。

解决方法: 在启动类前加上:

@MapperScan(basePackages = { "mapper所在的包路径" })

扫描mapper包下的所有mapper

关注
打赏
1660824269
查看更多评论
立即登录/注册

微信扫码登录

0.0447s