我將項(xiàng)目由springboot3.0.5升級(jí)為3.2.1時(shí)啟動(dòng)報(bào)錯(cuò)如下:
2024-01-08 14:59:34.245 ERROR 15604 --- [ 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)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:836)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:620)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:789)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347)
解決:pom.xml的mybatis-spring 版本升級(jí)為 3.0.3
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.5</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>
參考:Spring Boot 升級(jí) 3.2 報(bào)錯(cuò) Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String_java_有來(lái)技術(shù)團(tuán)隊(duì)-華為開發(fā)者聯(lián)盟HarmonyOS專區(qū) (csdn.net)
https://github.com/mybatis/spring/issues/855
https://github.com/baomidou/mybatis-plus/issues/5808
mybatis-plus-boot-starter(或mybatis-plus-spring-boot3-starter)升級(jí)到3.5.5
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.5</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>
或
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.5</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>
要不會(huì)報(bào)
Bean named 'ddlApplicationRunner' is expected to be of type 'org.springframework.boot.Runner' but was actually of type 'org.springframework.beans.factory.support.NullBean'
參考:Bean named‘ddlApplicationRunner‘is expected to be of type ‘org.springframework.boot.Runner‘_spring boot項(xiàng)目啟動(dòng)報(bào)錯(cuò) bean named 'ddlapplicationrunner-CSDN博客
【Springboot 3.2.1 & mybatis-plus】升級(jí)版本遇到的問題_bean named 'ddlapplicationrunner' is expected to b-CSDN博客
SpringBoot3和mybatisplus整合出現(xiàn)的問題_bean named 'ddlapplicationrunner' is expected to b-CSDN博客
springboot3.2.1集成Mybatisplus啟動(dòng)報(bào)錯(cuò)(沒事的時(shí)候就坑自己)_springboot 3.2.1整合mybatis-plus-CSDN博客
SpringBoot 3.2.1 啟動(dòng)報(bào)錯(cuò) · Issue #5867 · baomidou/mybatis-plus · GitHub
【SpringBoot3集成Mybatis-plus】啟動(dòng)報(bào)錯(cuò)問題解決-CSDN博客