springboot项目中mapper.xml文件时,报错如下:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Oct 11 22:20:51 CST 2021 There was an unexpected error
(type=Internal Server Error, status=500). Invalid bound statement (not
found): com.example.demo.mapper.UserMapper.ListUser
第一种方法:
mybatis.mapper-locations= classpath:mapper/*.xml
配置了.xml的路径,这样的话,就需要在resources下建立mapper文件夹,并将.xml放入其中即可,不需要在pom中进行操作。
第二种方法:
在配置文件中输入: