小码问答,有问必答!

PageHelperAutoConfiguration出现了 circular references循环引用怎么回事?

The dependencies of some of the beans in the application context form a cycle:


┌──->──┐

|  com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration

└──<-──┘



Action:


Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.


JavaEE

收藏

2个回答

我要回答

  • author
    王姐姐 2021-12-06 16:15

    补充:springboot2.6.0和springboot2.6.1只能使用pagehelper-spring-boot-starter1.4.1及以上版本,如果用低版本的pagehelper-spring-boot-starter,springboot需要降版本。

    • author
      王姐姐 2021-12-06 16:08
      springboot2.6.0版本和pagehelper-spring-boot-starter1.4.0有冲突:
      <parent>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-parent</artifactId>
          <version>2.6.0</version>  
      </parent>
      <dependency>
          <groupId>com.github.pagehelper</groupId>
          <artifactId>pagehelper-spring-boot-starter</artifactId>
          <version>1.4.0</version>
      </dependency>
      换一下版本就行。