springboot3.2整合mybatis-plus詳細(xì)代碼示例
springboot3.2 整合 mybatis-plus
springboot3.2 正式發(fā)布了 迫不及待地的感受了一下
結(jié)果在整個mybatis-plus 的時候遇到了如下報錯
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v3.2.0) 2023-11-27T11:21:35.279+08:00 INFO 38028 --- [livestreaming_commerce] [ main] c.l.LivestreamingCommerceApplication : Starting LivestreamingCommerceApplication using Java 21.0.1 with PID 38028 (D:\dev\java\code\livestreaming_commerce\target\classes started by 64626 in D:\dev\java\code\livestreaming_commerce) 2023-11-27T11:21:35.280+08:00 INFO 38028 --- [livestreaming_commerce] [ main] c.l.LivestreamingCommerceApplication : No active profile set, falling back to 1 default profile: "default" 2023-11-27T11:21:35.736+08:00 WARN 38028 --- [livestreaming_commerce] [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String 2023-11-27T11:21:35.740+08:00 INFO 38028 --- [livestreaming_commerce] [ main] .s.b.a.l.ConditionEvaluationReportLogger : Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2023-11-27T11:21:35.750+08:00 ERROR 38028 --- [livestreaming_commerce] [ main] o.s.boot.SpringApplication : Application run failed java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.1.jar:6.1.1] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:838) ~[spring-beans-6.1.1.jar:6.1.1] at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:620) ~[spring-beans-6.1.1.jar:6.1.1] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:573) ~[spring-beans-6.1.1.jar:6.1.1] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:532) ~[spring-beans-6.1.1.jar:6.1.1] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.1.jar:6.1.1] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:775) ~[spring-context-6.1.1.jar:6.1.1] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:597) ~[spring-context-6.1.1.jar:6.1.1] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.0.jar:3.2.0] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.2.0.jar:3.2.0] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455) ~[spring-boot-3.2.0.jar:3.2.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) ~[spring-boot-3.2.0.jar:3.2.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342) ~[spring-boot-3.2.0.jar:3.2.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331) ~[spring-boot-3.2.0.jar:3.2.0] at cn.lihaozhe.LivestreamingCommerceApplication.main(LivestreamingCommerceApplication.java:10) ~[classes/:na]
主要是由于 mybatis-plus 中 mybatis 的整合包版本不夠?qū)е碌?br />排除 mybatis-plus 中自帶的 mybatis 整合包,單獨(dú)引入即可
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.5.4.1</version> <exclusions> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>3.0.3</version> </dependency>
修改依賴后正常
總結(jié)
到此這篇關(guān)于springboot3.2整合mybatis-plus的文章就介紹到這了,更多相關(guān)springboot3.2整合mybatis-plus內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- SpringBoot整合Mybatis-plus實(shí)現(xiàn)多級評論功能
- SpringBoot3整合mybatis-plus的實(shí)現(xiàn)
- Springboot3整合Mybatis-plus3.5.3報錯問題解決
- SpringBoot整合mybatis-plus實(shí)現(xiàn)分頁查詢功能
- SpringBoot3和mybatis-plus整合出現(xiàn)的問題解決辦法
- SpringBoot3.2.2整合MyBatis-Plus3.5.5依賴不兼容的問題解決
- SpringBoot整合Mybatis-Plus實(shí)現(xiàn)關(guān)聯(lián)查詢
- 全網(wǎng)最新springboot整合mybatis-plus的過程
- SpringBoot3.3.X整合Mybatis-Plus的實(shí)現(xiàn)示例
相關(guān)文章
Java計(jì)算兩個漢字相似度的實(shí)現(xiàn)方法
有時候我們希望計(jì)算兩個漢字的相似度,比如文本的 OCR 等場景,用于識別糾正,本文給大家詳細(xì)介紹了Java計(jì)算兩個漢字相似度的實(shí)現(xiàn)方法,文中有詳細(xì)的實(shí)現(xiàn)代碼,需要的朋友可以參考下2023-11-11Spring boot + thymeleaf 后端直接給onclick函數(shù)賦值的實(shí)現(xiàn)代碼
這篇文章主要介紹了Spring boot + thymeleaf 后端直接給onclick函數(shù)賦值的實(shí)現(xiàn)代碼,需要的朋友可以參考下2017-06-06Spring Security 將用戶數(shù)據(jù)存入數(shù)據(jù)庫
這篇文章主要介紹了Spring Security 如何將用戶數(shù)據(jù)存入數(shù)據(jù)庫,幫助大家更好的理解和學(xué)習(xí)Spring Security,感興趣的朋友可以了解下2020-09-09Java結(jié)合Vue項(xiàng)目打包并進(jìn)行服務(wù)器部署
本文主要介紹了Java結(jié)合Vue項(xiàng)目打包并進(jìn)行服務(wù)器部署,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-07-07SpringBoot3?Web編程開發(fā)的工程搭建攔截器及測試工具示例
這篇文章主要介紹了SpringBoot3?Web編程開發(fā)的工程搭建攔截器及測試工具示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-08-08Springboot集成Spring Security實(shí)現(xiàn)JWT認(rèn)證的步驟詳解
這篇文章主要介紹了Springboot集成Spring Security實(shí)現(xiàn)JWT認(rèn)證的步驟詳解,幫助大家更好的理解和使用springboot,感興趣的朋友可以了解下2021-02-02