Today, I stepped into an interesting pit with mybatis. After a day’s searching, I didn’t find the problem. Let me tell you about the conventional solutions.
The command space of the mapping file of
- mybatis is inconsistent with the fully qualified name of the interface; it is possible that the name of the mapping file of mybatis is inconsistent with the class name of the interface; in another case, the method declared by the interface is not included in the mapping file.
But I checked n times! N times! There is no problem. It’s perfect, but it’s a mistake!
The result is that the XML file is not compiled!
When compiling, put the XML file in the folder like this
you can see that the XML file is not compiled.
We are here pom.xml Add the following code to the
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
Recompile
XML is compiled to solve the problem
Read More:
- org.springframework.orm . hibernate3. Hibernatequeryexception: XXX is not mapped solution
- Project with path ‘XXXX’ could not be found
- Implementation of Python switch / case statements
- Using the pit in Git that rebase encountered two could not apply XXXX
- Failed to execute goal on project XXXX-api: Could not resolve dependencies for pro
- CRM related SQL statements
- Continue Long Statements on Multiple Lines Matlab
- Spring security failed to log in, error: there is no passwordencoder mapped for the ID “null”
- Eclipse specifies JDK version to start, and resolves version XXXX of the JVM is not suitable
- Docker creation container cannot find network card: error response from daemon: network XXXX not found
- Mybatis custom list collection parser
- Result Maps collection already contains value for com.xxx.xxxMapper . baseresultmap problem solving
- Analysis of [error code [942], ora-00942 in synchronization of DDL statements in ogg
- error: src refspec master does not match any error:failed to push some refs to ‘[email protected]:xxxx
- About writing [if] and [else] statements in JSP, Syntax error on token “else”, delete this token
- Oracle error collection solution
- Java garbage collection
- Visual studio 2012, a complete collection of solutions to flash back windows after running
- The most complete collection of solutions to Tortoise SVN Clean up failure
- Design of MQ asynchronous collection report data