解決springboot3:mybatis-plus依賴錯誤:org.springframework.beans.factory.UnsatisfiedDependencyException
mybatis-plus報錯
今天試了試springboot3
UnsatisfiedDependencyException: 不滿足依賴關系異常
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 '此處省略一大堆'
我是第一次碰到,然后去搜了幾篇文章,說什么的都有。
但是報錯信息是一樣的,解決辦法很簡單:
只需要讓mybatis-plus和mybatis版本保持一致
問題原因
mybatis-plus和mybatis依賴關系異常

解決辦法
版本號保持一致!!!

我個人非常喜歡的一個主題
是有點花里胡哨的,歡迎推薦

總結
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
- 解決Mybatis報錯:org.apache.ibatis.reflection.ReflectionException: There is no getter for property named問題
- 解決mybatis generator MySQL自增ID出現(xiàn)重復問題MySQLIntegrityConstraintViolationException
- MyBatis嵌套查詢collection報錯:org.apache.ibatis.exceptions.TooManyResultsException
- 解決Mybatis出現(xiàn)報錯Error querying database.Cause: java.lang.IndexOutOfBoundsException: Index 9 out of
- 解決mybatis plus報錯com.microsoft.sqlserver.jdbc.SQLServerException:必須執(zhí)行該語句才能獲得結果
- 關于MyBatisSystemException異常產生的原因及解決過程
相關文章
一文搞懂MyBatis多數據源Starter實現(xiàn)
本文將實現(xiàn)一個MyBatis的Springboot的Starter包,引用這個Starter包后,僅需要提供少量配置信息,就能夠完成MyBatis多數據源的初始化和使用,需要的小伙伴可以參考一下2023-04-04
Java中的BaseTypeHandler自定義類型轉換器的使用
這篇文章主要介紹了Java中的BaseTypeHandler自定義類型轉換器的使用,文章圍繞主題展開詳細的內容介紹,具有一定的參考價值,需要的小伙伴可以參考一下2022-05-05

