1. 程式人生 > >spring整合mybatis bug解決java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ...

spring整合mybatis bug解決java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ...

post argument 出現 dao 結果 blog sta 出錯 lec

spring整合mybatis時候出現了這個bug

java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.jpj.base.dao.UserDaoI.getUserByUsername通過查找資料解決了這個bug,解決方式是在sql的xml配置裏面有一個配置

<mapper namespace="com.jpj.base.model.TUser" >

這個配置應該是對應的Dao接口,我寫成了model類了結果一直出錯,改為到接口

<mapper namespace="com.jpj.base.dao.UserDaoI" >

spring整合mybatis bug解決java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ...