Invalid bound statement (not found):报错解决方法
报错信息:
Invalid bound statement (not found): com.atguigu.auth.mapper.SysMenuMapper.findMenuListByUserId
因为:maven加载机制
maven默认情况下,只会加载编译ser-main-java目录里面java类型文件,其他类型文件不会进行加载
解决方法:
1、吧xml文件放到resources目录下面
2、通过配置方式进行加载
1、在pom.xml
<!-- maven记载机制1、在pom.xml添加--> <resources><resource><directory>src/main/java</directory><includes><include>**/*.yml</include><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource><resource><directory>src/main/resources</directory><includes><include>**/*.yml</include><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource> </resources>
2、项目配置文件添加
mybatis-plus:mapper-locations: classpath:com/atguigu/auth/mapper/xml/*.xml # 加载xml文件