报上述错误的时候,还有其他错误比如Error Creating bean with name ‘xxx‘,这个问题应该是springboot和mybatis-plus版本不兼容的问题,主要原因是mybatis-plus的版本太低了。
我这里使用的springboot版本如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
对应的mybatis-plus版本如下
<!--mybatis-plus 持久层-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.3</version>
</dependency>
就能正常跑啦