1.网上的都试了
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.bjsxt.mapper.UsersMapper.selectUsersAll] with root cause
UsersMapper.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.bjsxt.mapper">
<resultMap id="BaseResultMap" type=" com.bjsxt.pojo.Users">
<result column="id" property="id"></result>
<result column="name" property="name"></result>
<result column="age" property="age"></result>
</resultMap>
<!-- <insert id="insertUser" parameterType="com.bjsxt.pojo.Users">-->
<!-- insert into users(id,name,age,password) values(#{id},#{name},#{age},#{password})-->
<!-- </insert>-->
<select id="selectUsersAll" resultMap="BaseResultMap">
select * from user
</select>
</mapper>
UserMapper.java
package com.bjsxt.mapper;
import com.bjsxt.pojo.Users;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface UsersMapper {
void insertUser(Users users);
List<Users> selectUsersAll();
}