SpringBoot与Mybatis整合中
错误原因:resource/mapper/UserMapper.xml中包名路径写错
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.mapper.UserMapper">
<!--错误原因,mapper namespace后的路径 要对应Mapper interface所在的包名
原:"com.item.mapper.UserMapper
现:com.itheima.mapper.UserMapper
-->
<select id="queryUserList" resultType="user">
select * from user
</select>
</mapper>
如图: