Solved: Mybatis binding exception: error BindingException: Invalid bound statement (not found): com....xxxMapper

Problem phenomenon:

I encountered a bug in the project before, and the error was reported as follows:

org.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxxxxxxxx.mappers.xxxMapper


problem analysis:

From the error message, it can be seen that the meaning of the error is probably:

Mybatis binding exception: Cannot find the xxxMapper.xml file corresponding to this xxxMapper interface.

Directly locate this xxxMapper interface to take a look:

 

No problem, go to the xml file corresponding to this Mapper interface to see:

Now you can know the problem:

This is because the two files have different names. In mybatis, you need to ensure that the Mapper interface and the Mapper.xml file have the same name. If the name is the Dao interface, it must be the Daoxml file with the same name; (Note: Even if the configuration is correct in the xml file The mapping interface path does not work, you must ensure that the file name has the same name)


Solution:

Ensure that the two files have the same name:

Guess you like

Origin blog.csdn.net/weixin_42585386/article/details/108647730