Tag Archives: spring boot integrated PageHelper Error

[Solved] spring boot integrated PageHelper Error

The error reporting information is as follows:

 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
└──<-──┘

└──<-──┘

The spring boot version is 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>

The page helper version is 1.2.3

<!-- pageHelper -->
<dependency>
   <groupId>com.github.pagehelper</groupId>
   <artifactId>pagehelper-spring-boot-starter</artifactId>
   <version>1.2.3</version>
</dependency>

After verification by many parties, it is found that the error is due to the conflict between the springboot version and the PageHelper version.

Solution:

    1. reduce the springboot version, such as 2.5 3 (the PageHelper version remains unchanged from 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>

Increase the version of PageHelper, such as 1.4 1 (the springboot version remains unchanged from 2.6.1)

<!-- pageHelper -->
<dependency>
   <groupId>com.github.pagehelper</groupId>
   <artifactId>pagehelper-spring-boot-starter</artifactId>
   <version>1.4.1</version>
</dependency>

I hope my solution will help you a little. Good luck!!!