springboot3引入Mybatisplus报Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String
看官网信息,发现是版本不一致导致的,springboot3是需要引入下面的那个依赖。使用mybatis-plus,启动报错。引入新的组件后解决!
·
背景
使用mybatis-plus,启动报错。
核心报错信息
2024-01-30T11:14:25.327+08:00 ERROR 64042 --- [ 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.3.jar:6.1.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:836) ~[spring-beans-6.1.3.jar:6.1.3]
原因及解决
工程使用的springboot3及mybatis plus的版本分别为:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version>
<relativePath></relativePath>
</parent>
<dependencies>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
</dependencies>
看官网信息,发现是版本不一致导致的,springboot3是需要引入下面的那个依赖。
引入新的组件后解决!
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.5</version>
</dependency>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)