报错Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String或者xxxController/xxxService/xxxMapper的bean无法被创建。
原因mybatisplus中的mybatis-spring版本过低,与springboot版本冲突
解决方法:
手动排除并手动加入mybatis-spring的依赖
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.5</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>
本人对应的父依赖spring-boot-starter-parent:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version>
</parent>
2024-6-18 踩坑:springboot 和mybatisplus 整合后,@Service 注解是写在Service接口的实现类上,不是写在Service接口上!!!!!!!!
按照mybatis的写法,@Service 注解一般写在接口上 ,故犯错。