1. Error Messages:
Mapped Statements collection does not contain value for com.lsy.mapper.UsersMapper.selectUsersAll
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.lsy.mapper.UsersMapper.selectUsersAll
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.lsy.mapper.UsersMapper.selectUsersAll
One of the reasons:
mapper namespace writes the wrong file name:
usersmapper in mapper.xml file is written as usermapper
The correct wording is as follows:
<?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.lsy.mapper.UsersMapper">
<select id="selectUsersAll" resultType="com.lsy.pojo.Users">
select * from users
</select>
</mapper>
Read More:
- Build a mybatis and it will appear session.selectOne Method error
- Mybatis reports an error (error building sqlsession.) when using annotations without deleting redundant files
- How to Solve Mybatis error: invalid bound statement (not found)
- [Solved] Mybatis-Plus Error: Invalid bound statement (not found)
- Mybatis Error: Invalid bound statement (not found)
- [Solved] Tk-Mybatis Error: tk.mybatis.mapper.MapperException:
- [Solved] JavaErrors_mybatis collection column Pass Value Error
- [Solved] org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession…
- [Solved] BindingException: Type interface XXX is not known to the MapperRegistry
- [Solved] Mybatis insert Error: Cause: java.sql.SQLException: SQL String cannot be empty
- o.s.boot.SpringApplication, Error creating bean with name ‘paymentImpl‘, xml Configuration file error
- [Solved] Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException
- Mybatis single parameter pass in exception (How to Fix)
- [How to Solve] Invalid bound statement (not found)
- How to Solve Error: Error parsing mapper XML
- springboot Integrate mybatis Error: Error creating bean with name ‘deptController‘: Unsatisfied dependency expresse
- How to Converte Java objects to jsonnode in Jackson (Four Methods)
- [Solved] Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration
- Mybatis-plus: How to Execute Native SQL