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:
- [Solved] org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession…
- [Solved] nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method
- [Solved] Mybatis add dependencies Error: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration.
- [Solved] Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- [Solved] mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- [Solved] Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration
- [Solved] Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException
- [Solved] org.apache.ibatis.executor.ExecutorException: No constructor found in void matching [java.lang.String]
- [Solved] Docker Elasticsearch8.4.0 Error: Exception in thread “main” java.nio.file.FileSystemException
- [Solved] qrcode-error: Exception in thread “main” java.lang.NoClassDefFoundError…
- [Solved] Exception in thread “main“ java.lang.NoSuchFieldError: level
- Java uses class array to report error Exception in thread “main” java.lang.NullPointerException solution
- [Solved] Hadoop Error: Exception in thread “main“ java.io.IOException: Error opening job jar: /usr/local/hadoop-2.
- Mybatis single parameter pass in exception (How to Fix)
- [Solved] org.apache.flink.client.program.ProgramInvocationException: The main method caused an error
- Jmeter Error: ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
- [Solved] Mybatis.generator error: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2
- [Solved] ssm Error: Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: Executor was closed
- How to Solve SQL comments error in the mybatis query