1.
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>
II
If it is the above error: change the UTF-8 in your XML file to utf8 and run it again.
Read More:
- ### Error building SqlSession. ### The error may exist in com/itrs/mapper/UserMapper.xml ### Cause:
- [Solved] Error building SqlSession. ### The error may exist in com/itrs/mapper/OrderMapper.xml
- [How to Fix] manual close is not allowed over a Spring managed SqlSession
- [Solved] java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession
- QT Creator Error while building deploying project
- MAC: Failed building wheel for lxml [How to Solve]
- [Solved] Xcode error: cycle inside*******; building could produce unreliable results.
- [Solved] python Connect hive to Install sasl Error: Building wheel for sasl (setup.py) … error
- Error: an error occurred while performing the step: “building kernel modules”. See/var/log/NV
- [Solved] Mac Unity Export Android Project Error: Error building Player: Win32Exception
- [Solved] Vcpkg Install Building package brotli:x64-windows failed with: BUILD_FAILED Locking applocal.ps1
- Maven Configurate Error: [ERROR] Error executing Maven. [ERROR] 1 problem was encountered while building the effec
- Mac cytoolz install Error: ERROR: Failed building wheel for cytoolz
- Mybatis error under Springboot project: Invalid bound statement (not found)
- Spring deployment error: Could not open ServletContext resource [/db.properties]
- [Solved] Mybatis Error: Resources.getResourceAsStream(resource) cannot find the method
- [How to Solve] Error: Invalid or corrupt jarfile…
- Mybatis-plus calls its own method error: Invalid bound statement
- How to Solve Archetype generate Error
- [Solved] Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource