Mybatis Error: Invalid bound statement (not found)

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

    1. 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: