Super detailed – springboot + mybatisplus can’t find a solution to mapper using XML
org.apache.ibatis.binding.bindingexception: invalid bound statement (not found): com.zyh.springboot.mapper.bowmapper.findlist
1. First, please look at my project directory, and my XML file is placed under mapper/XML
2, Add the following content in application.yml.
in fact, many students added mybatis plus at the beginning of the project, then add
mapper locations: classpath/COM/zyh/springboot/mapper/XML /. XML at the end.
note: there is no link between packages, such as com.zyh.springboot, which is incorrect
you can see that my mapper locations path is my XML path
#print sql code mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl map-underscore-to-camel-case: true type-aliases-package: com.zyh.springboot.entity mapper-locations: classpath*:/com/zyh/springboot/mapper/xml/*.xml
3. Add an XML resource to pom.xml. This step is very important. If you don’t add it, you will always report an error.
regardless of the path, you just need to fill in * /. XML
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build>
4. Save the code, run the environment, and you can find the mapper
- Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build Exception caught: basedir src/mai
- Update project manually_ Solution of too large jar package in springboot
- Error resolving version for plugin ‘org.apache.maven.plugins:maven-compiler-plugin’ from the repo…
- How to Fix The error may exist in com/kuang/dao/UserMapper.xml
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project Hello
- Related configuration of mybatis project
- Maven compilation error: package does not exist jar package does not exist
- How to Fix Invalid bound statement (not found) Error
- Springboot integrated with mybatis
- MVN error: @ param not found
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Maven invalid source release 11
- [Fixed]No bean named ‘sqlSessionFactoryBean’ available
- org.apache.jasper . jasperexception: unable to compile class for jsp: error resolution
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)
- Import Maven project pom.xml File error
- Maven skip unit test- maven.test.skip And skipstests
- Mapped Statements collection does not contain value for XXXX
- Maven skip unit test
- The icon on the layui page is not displayed, and an error message is reported: Failed to decode downloaded font …..