日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题

發布時間:2024/3/12 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

解決Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的問題

錯誤代碼:

二月 13, 2022 7:43:04 下午 org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName 信息: Loaded JDBC driver: com.mysql.cj.jdbc.Driver 二月 13, 2022 7:43:05 下午 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl warn 警告: Property 'mapperLocations' was specified but matching resources are not found. Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.at org.apache.ibatis.binding.MapperRegistry.getMapper(MapperRegistry.java:47)at org.apache.ibatis.session.Configuration.getMapper(Configuration.java:779)at org.mybatis.spring.SqlSessionTemplate.getMapper(SqlSessionTemplate.java:311)at com.kuang.mapper.UserMapperImpl.selectUser(UserMapperImpl.java:19)at MyTest.main(MyTest.java:10)

經過檢查發現,target中未生成 UserMapper.xml文件。

暫時的解決辦法是把以前文件中的 target -->classes-->com-->kuang-->mapper中的UserMapper.xml文件復制下來,粘貼到現在那個文件的target同樣位置中,非常的治標不治本。

或者重新創建一個項目,編寫同樣的代碼。感覺可能是創建項目的時候idea出錯的問題。

暫未找到解決方法

看了四個小時屬實是心態崩了,記錄下來等level更高之后再嘗試解決。

路徑:spring-study? -->? spring-12-transaction

總結

以上是生活随笔為你收集整理的解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。