The above error occurred:
Copy the XML file in Dao/mapper to the corresponding location of the test class in the target folder. If it runs successfully, delete it, and follow the steps below. (this XML file may be under other packages)
Comparison before and after copying:
Step ①: ensure that the path of the test class is the same as that of the corresponding class in main.
Step 2: view the XML file of your own resources & lt; mappers> Whether the path in is correct (note that slashes are used instead of dots)
Step ③: check whether the path behind the namespace in the XML file of your Dao/mapper package is correct. (this XML file can be under other packages)
Step ④: in your own POM Add the following code to XML, refresh Maven or restart idea. (because the Maven project contract is greater than the configuration, idea will not load the resource files in the Java source directory into the project.)
<!--Configure resources in build to prevent our resource export from failing --> <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources> </build>
If it is the above error: change the UTF-8 in your XML file to utf8 and run it again.
- Mybatis error under Springboot project: Invalid bound statement (not found)
- [How to Solve] Error: Invalid or corrupt jarfile…
- Spring deployment error: Could not open ServletContext resource [/db.properties]
- ### Error building SqlSession. ### The error may exist in com/itrs/mapper/UserMapper.xml ### Cause:
- Mybatis-plus calls its own method error: Invalid bound statement
- [Solved] Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource
- How to Solve Archetype generate Error
- Solution to java.lang.IllegalArgumentException: Property’dataSource’ is required
- JSP error: The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- [Solved] VScode Run C++ File Error: fatal error：opencv2\core.hpp:No such file or diretory
- IDEA Error: clear read-only status [How to Solve]
- [Solved] Android resource linking failed, error: failed linking references.
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- [Solved] Error building SqlSession. ### The error may exist in com/itrs/mapper/OrderMapper.xml
- How to Solve [error] malformed \uxxxx encoding Error
- [Solved] IDEA Start Project Error: Abnormal build process termination:Could not create the Java Virtual Machine.
- Prompt unknown error in pom.xml of Maven project
- Springboot package error: failed to execute goal org.apache.maven.plugins:maven-resources-plugin: 3.2.0…
- Vue Browser Error: Failed to load resource: the server responded with a status of 404 (Not Found)
- Start error in maven web project java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener