mybatis單元測試成功,但是起服務測試失敗的原因:mybatis.xml配置錯了!
<mappers>
<!--<package name="model.mapper"/>--> 只適用於注解方式
// 以下兩個適用於mapper.xml方式
<mapper class="model.mapper.StudentInfoMapper"/>
<mapper resource="model/mapper/studentInfoMapper.xml"/>
</mappers>
以上適用於StudentinfoMapper.java 和 studentinfoMapper.xml大小寫沒有完全對等的情況

浙公网安备 33010602011771号