首页 > 其他分享 >SpringBoot+MyBatisPlus报错 Invalid value type for attribute 'factoryBeanObjectType' 或者Bean n

SpringBoot+MyBatisPlus报错 Invalid value type for attribute 'factoryBeanObjectType' 或者Bean n

时间:2024-04-26 18:45:42浏览次数:23  
标签:ddlApplicationRunner 依赖 boot springframework 报错 mybatis org type

依赖版本

org.springframework.boot:spring-boot-starter-web:3.2.5
com.baomidou:mybatis-plus-boot-starter:3.5.5

错误Invalid value type for attribute 'factoryBeanObjectType'

问题原因:这个问题是由于依赖传递导致,在MyBatis起步依赖中的myBatis-spring版本过低,导致程序无法运行
解决方法:在pom.xml文件中配置一个更高版本的myBatis-spring依赖即可,别忘了刷新maven配置哦~

<dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>3.0.3</version>
</dependency>

解决前 -- 起步依赖的直接依赖中,myBatis-Spring的版本为2.1.1

解决后 --- 3.0.3版本的myBatis-Spring将其覆盖


错误Bean named 'ddlApplicationRunner' is expected to be of type 'org.springframework.boot.Runner' but was actually of type 'org.springframework.beans.factory.support.NullBean'

解决完上面的问题后,紧接着报如题错误
很简单,只需要将mybatis-plus-boot-starter更新成3.5.5版本即可

<dependency>
     <groupId>com.baomidou</groupId>
     <artifactId>mybatis-plus-boot-starter</artifactId>
     <version>3.5.5</version>
</dependency>

参考链接

MyBatisPlus使用时报错Invalid value type for attribute ‘factoryBeanObjectType‘
已经解决了,依赖改成

标签:ddlApplicationRunner,依赖,boot,springframework,报错,mybatis,org,type
From: https://www.cnblogs.com/f-cat/p/18160669

相关文章