解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题
生活随笔
收集整理的這篇文章主要介紹了
解决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.的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: NCS8803 高级缩放功能的低功耗HD
- 下一篇: d3dcompiler_47.dll缺失