mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement ,not found

I once made a similar mistake which turned out that the directories were incorrect.

If the UserMapper's namespace is com.mybatisdemo.mappers.UserMapper, make sure mapper-locations is src/resources/com/mybatisdemo/mappers/.

Sometimes we might create a directory named com.mybatisdemo.mappers, then its location turns out to be src/resources/com.mybatisdemo.mappers which is wrong.