解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题
生活随笔
收集整理的這篇文章主要介紹了
解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
解決Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的問題
錯(cuò)誤代碼:
二月 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)經(jīng)過檢查發(fā)現(xiàn),target中未生成 UserMapper.xml文件。
暫時(shí)的解決辦法是把以前文件中的 target -->classes-->com-->kuang-->mapper中的UserMapper.xml文件復(fù)制下來,粘貼到現(xiàn)在那個(gè)文件的target同樣位置中,非常的治標(biāo)不治本。
或者重新創(chuàng)建一個(gè)項(xiàng)目,編寫同樣的代碼。感覺可能是創(chuàng)建項(xiàng)目的時(shí)候idea出錯(cuò)的問題。
暫未找到解決方法
看了四個(gè)小時(shí)屬實(shí)是心態(tài)崩了,記錄下來等level更高之后再嘗試解決。
路徑:spring-study? -->? spring-12-transaction
總結(jié)
以上是生活随笔為你收集整理的解决Type interface com.kuang.mapper.UserMapper is not known to the MapperRegistry.的问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: NCS8803 高级缩放功能的低功耗HD
- 下一篇: d3dcompiler_47.dll缺失