report errors:
### The error may exist in com/cth/dao/UserImpl.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/cth/dao/UserImpl.xml
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
at com.cth.domain.User.main(User.java:17)
……
reason
Because the userimpl.XML
file under COM/CTH/Dao/
has not been compiled into the corresponding directory under the target/classes
directory, I don’t believe you can find it under the target/classes
directory in the project. You can’t find it
Solution:
Method 1: put the files in COM/CTH/Dao
directory under resource
Method 2: add the following code to the POM file
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
Similar Posts:
- [Solved] Mybatis: the binding mapper cannot be found Error: Org.apache.ibatis.binding.bindingexception: invalid bound statement (not found)
- MyBatis Error: Error building SqlSession [How to Solve]
- [Solved] Mybatis Error: Invalid bound statement (not found)
- The project is normal in eclipse, and an error is reported in IDEA [How to Solve]
- [Solved] Springboot Error: invalid bound statement (not found)
- [Solved] Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
- [Solved] Mybatis Error: Invalid bound statement (not found)
- [Solved] Mybatis Codes Error: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver
- [Solved] Browser Error: Failed to decode downloaded font and OTS parsing error: Failed to convert *** font to ***
- [Solved] Nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):