解決springboot3:mybatis-plus依賴錯(cuò)誤:org.springframework.beans.factory.UnsatisfiedDependencyException
mybatis-plus報(bào)錯(cuò)
今天試了試springboot3
UnsatisfiedDependencyException: 不滿足依賴關(guān)系異常
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': No qualifying bean of type 'com.example.demo.mapper.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:716) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:696) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.0.11.jar:6.0.11]
at '此處省略一大堆'
我是第一次碰到,然后去搜了幾篇文章,說什么的都有。
但是報(bào)錯(cuò)信息是一樣的,解決辦法很簡單:
只需要讓mybatis-plus和mybatis版本保持一致
問題原因
mybatis-plus和mybatis依賴關(guān)系異常
解決辦法
版本號保持一致!!!
我個(gè)人非常喜歡的一個(gè)主題
是有點(diǎn)花里胡哨的,歡迎推薦
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
- 解決Mybatis報(bào)錯(cuò):org.apache.ibatis.reflection.ReflectionException: There is no getter for property named問題
- 解決mybatis generator MySQL自增ID出現(xiàn)重復(fù)問題MySQLIntegrityConstraintViolationException
- MyBatis嵌套查詢collection報(bào)錯(cuò):org.apache.ibatis.exceptions.TooManyResultsException
- 解決Mybatis出現(xiàn)報(bào)錯(cuò)Error querying database.Cause: java.lang.IndexOutOfBoundsException: Index 9 out of
- 解決mybatis plus報(bào)錯(cuò)com.microsoft.sqlserver.jdbc.SQLServerException:必須執(zhí)行該語句才能獲得結(jié)果
- 關(guān)于MyBatisSystemException異常產(chǎn)生的原因及解決過程
相關(guān)文章
一文搞懂MyBatis多數(shù)據(jù)源Starter實(shí)現(xiàn)
本文將實(shí)現(xiàn)一個(gè)MyBatis的Springboot的Starter包,引用這個(gè)Starter包后,僅需要提供少量配置信息,就能夠完成MyBatis多數(shù)據(jù)源的初始化和使用,需要的小伙伴可以參考一下2023-04-04Java中的BaseTypeHandler自定義類型轉(zhuǎn)換器的使用
這篇文章主要介紹了Java中的BaseTypeHandler自定義類型轉(zhuǎn)換器的使用,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-05-05idea啟動(dòng)tomcat控制臺(tái)中文亂碼的三種情況解決
本文主要介紹了idea啟動(dòng)tomcat控制臺(tái)中文亂碼,主要包括三種情況,分別介紹了一下解決方法,具有一定的參考價(jià)值,感興趣的可以了解一下2023-10-10JavaWeb監(jiān)聽器Listener實(shí)例解析
這篇文章主要為大家詳細(xì)介紹了JavaWeb監(jiān)聽器Listener實(shí)例,針對監(jiān)聽器進(jìn)行進(jìn)行細(xì)致分析,感興趣的小伙伴們可以參考一下2016-08-08