e_ddjava 2022-03-31 16:57 采纳率: 74.2%
浏览 27
已结题

springboot整合mybatis出错,好像是xml没扫到

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.song.springmybatisboot.dao.StudaoInterface.pg1

这句话也加了

mybatis:
mapper-locations: classpath:/resources/mapper/*.xml
type-aliases-package: com.song.springmybatisboot.dao
没用

  • 写回答

1条回答 默认 最新

  • wyz0923 2022-03-31 18:49
    关注
    
    mapper-locations: classpath:/resources/mapper/*.xml   修改成   mapper-locations: classpath:mapper/*.xml
    
    

    如果还没有好
    然后排查一下你的mapper 接口有没有被扫描到容器里 排查一下你的target 目录里有没有对应的mapper.xml文件

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 4月9日
  • 已采纳回答 4月1日
  • 创建了问题 3月31日