1. 程式人生 > >HTTP Status 500: Expected one result (or null) to be returned by selectOne(), but found: 2

HTTP Status 500: Expected one result (or null) to be returned by selectOne(), but found: 2

瀏覽器報這種錯:HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2

 

ps:內心早已崩潰~寫個登入而已這麼多搞事情的報錯~就比如上面這行報錯,花了我幾個小時去找錯誤!沒想到吧~   原來這行程式碼指的是資料庫的資料有重複的~要不是我最後找不出bug,去瞅了兩眼資料表的資料,我還真發現不了使用者表有兩行資料是一摸一樣的,難怪登入對的賬號就報這種錯,輸入錯的賬號就不報錯,原來是資料重複多出來了,早就應該想到的,我竟然固執的以為mapper檔案出錯,還以為傳參出錯,什麼能想到的都想到了,就是沒有解決問題,這下好了,就算找出了問題所在,我也不開心,哼~(搞死我了~哭~),最後再說一次以後做登入的資料別寫重複的登入資料了,小心頭,唉,粗心了!

·