When starting the project today, the spring boot reported an error.
This error is reported because the mapper file has not been scanned.
Why didn’t you scan it?
Cause analysis
-
- incorrect namespace method undefined: the method in mapper.xml is not defined in the Java class. The return value is incorrect: the return value of the method in the Java class is different from the return value in the XML file (resultmap or resulttype). The configuration path is incorrect: is the configuration path of the mapper file correct
The error reason of my project is the fourth: the configuration path of mapper file is incorrect
The path I configured in the project is: all XML files under the mapper folder and its subfolders.
However, my project doesn’t have a mapper folder at all
Just looking at this folder, I don’t know whether it is a primary directory or a hierarchical directory.
When I created a new folder, I entered it in one breath
Although the name of the folder is written correctly, the name of the folder is mapper.subnet
In this case, there is no mapper folder at all, so it will not be able to match.
Read More:
- [Solved] Mybatis-Plus Error: Invalid bound statement (not found)
- How to Solve Mybatis error: invalid bound statement (not found)
- Springboot mybatis Integrate Error: Invalid bound statement (not found): com…DepartmentMapper.save
- [How to Solve] Invalid bound statement (not found)
- How to Solve Error: Invalid bound statement (not found)
- There was an unexpected error (type=Internal Server Error, status=500).Invalid bound statement (not
- [Solved] Mybatis Batch Modify Error: multi-statement not allow
- Using mybatis statement.getGenreatedKeys(); usegeneratedkeys = “true”; using self incrementing primary key to get primary key value policy and Oracle do not support self incrementing, Oracle uses sequence
- [Solved] Mybatis Error: Could not find resource mybatis-conf.xml
- Mybatis plus configuration console prints complete SQL statement with parameters
- Mybatis sets the primary key Auto-Increment error: No setter found for the keyProperty
- [Solved] Tk-Mybatis Error: tk.mybatis.mapper.MapperException:
- [Solved] Mybatis.generator error: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2
- Mybatis Error: Error instantiating class bakou.entity.Person with invalid types () or value)
- HQL statement query error: could not resolve property [Solved]
- Ternary operator in Java?: error: not a statement
- [Solved] mybatis plus Insert Error: mybatis plus Error setting null for parameter #1 with JdbcType OTHER
- [Solved] Could not find resource COM / atguigu / Dao / studentdao.xm, the mapper file for storing SQL statements could not be found and an error occurred
- Mybatis-plus: How to Execute Native SQL
- [Solved] Invalid Gradle JDK configuration found. Open Gradle Settings Change JDK location