[Solved] Mybatis Error: Invalid bound statement (not found)

Error reason: mapper file does not match

Check whether the mapper file is written incorrectly

Check the import configuration of mapper. Note that mapper cannot be imported across packages

Check whether the corresponding mapper file is generated in target/classes. If not, the solution is as follows

Add the following configuration to pom.xml, clean and recompile

</build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
            <includes>
                <include>**/*.*</include>
            </includes>
        </resource>
    </resources>
</build>

Similar Posts: