About Springboot can not find the problem mapper.xml

Today error when writing springboot project org.apache.ibatis.binding.BindingException: Invalid bound statement (not found ), looking for information for a long time have not been solved, but summed up some experience

1. Check whether the package name xml file is located and interface corresponding package name one by one

2. Remove the xml file in the Chinese comments

3. Check the configuration file path: if the startup file mapper.xml not in the same class next sub, must be configured classpath *: In the same package, using the classpath *: or classpath: can

 

 

4. Check the target folder has no corresponding file mapper.xml

 

If not at all guarantee the right path, the first run mvn clean executing mvn compile

 

 

5. My mistake:

Written mapper-location should actually mapper-locations

 

Must be careful not wrong.

Guess you like

Origin www.cnblogs.com/shuo2018/p/12175516.html