报错描述信息如下
Error creating bean with name
'com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration'
Description:
The dependencies of some of the beans in the application context form a cycle:
┌──->──┐
| com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration
└──<-──┘
└──<-──┘
springboot版本是2.6.1
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
pagehelper版本是1.2.3
<!-- pageHelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
经多方求证发现报错原因在于springboot版本与pagehelper版本冲突。
解决方案:
- 将springboot版本降低,如:2.5.3(pagehelper版本维持1.2.3不变)
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.3</version> <relativePath/> <!-- lookup parent from repository --> </parent>
-
将pagehelper版本提高,如:1.4.1(springboot版本维持2.6.1不变)
<!-- pageHelper --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.4.1</version> </dependency>
希望我的解决方案对你有一点小小的帮助,祝你好运 !!!