Invalid value type for attribute ‘factoryBeanObjectType’: java.lang.String
springboo3和mybatisplus整合出现Invalid value type for attribute ‘factoryBeanObjectType’: java.lang.String错误,原因是
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.4.1</version>
</dependency>
依赖内部内部的
<dependency>
<artifactId>mybatis-spring</artifactId>
<groupId>org.mybatis</groupId>
</dependency>
依赖版本过低
处理方案是,排除原有的版本,引入新的依赖版本
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.4.1</version>
<exclusions>
<exclusion>
<artifactId>mybatis-spring</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>3.0.3</version>
</dependency>
同时又会出现错误
Bean named 'ddlApplicationRunner' is expected to be of type 'org.springframework.boot.Runner' but was actually of type 'org.springframework.beans.factory.support.NullBean'
需要注入一个名为DdlApplicationRunner的Bean
@Bean
public DdlApplicationRunner ddlApplicationRunner(@Autowired(required = false) List ddlList) {
return new DdlApplicationRunner(ddlList);
}
标签:
java
springboot
本文转载自: https://blog.csdn.net/m0_63948786/article/details/135278501
版权归原作者 稻心 所有, 如有侵权,请联系我们删除。
版权归原作者 稻心 所有, 如有侵权,请联系我们删除。