Rumah > Soal Jawab > teks badan
这是mybatis-config.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url"
value="jdbc:mysql://localhost:3306/jupan_mail?useUnicode=true&characterEncoding=UTF-8&"/>
<property name="username" value="root"/>
<property name="password" value="password"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="com/salamander/backcal/mapping/MailChangeMapper.xml"/>
</mappers>
</configuration>
这是项目结构:
单元测试报错:
Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/salamander/backcal/dao/MailChangeMapper.xml
迷茫2017-04-18 10:20:19
Cari penyelesaian (sebabnya ialah: idea tidak akan menyusun fail xml dalam direktori java src):
Tambah nod dalam pom.xml:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
Rujukan: http://www.cnblogs.com/canger...
黄舟2017-04-18 10:20:19
com/salamander/backcal/dao/MailChangeMapper.xml
Laluan di mana ralat dilaporkan adalah di bawah pakej dao
.
Tetapi konfigurasi yang anda siarkan berbeza daripada laluan ralat.
Membangkitkan pemikiran