api-boot icon indicating copy to clipboard operation
api-boot copied to clipboard

启动报循环依赖错误

Open randeexiong opened this issue 3 years ago • 7 comments

启动会报循环依赖错误

***************************
APPLICATION FAILED TO START
***************************

Description:

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

   documentationPluginsBootstrapper defined in URL [jar:file:/D:/tools/java/maven/repo/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]
      ↓
   webMvcRequestHandlerProvider defined in URL [jar:file:/D:/tools/java/maven/repo/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]
      ↓
   org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerEndpointsConfiguration (field private java.util.List org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerEndpointsConfiguration.configurers)
┌─────┐
|  org.minbox.framework.api.boot.autoconfigure.oauth.ApiBootAuthorizationMemoryServerAutoConfiguration (field private org.springframework.security.oauth2.provider.token.TokenStore org.minbox.framework.oauth.AuthorizationServerConfiguration.tokenStore)
└─────┘


randeexiong avatar Sep 09 '22 01:09 randeexiong

@randeexiong 把你的pom.xml贴出来

hengboy avatar Sep 09 '22 01:09 hengboy

apiboot只提供了依赖,你需要指定项目parent为spring-boot-starter-parent的原因不仅是依赖还有其他的配置,比如:项目打包

hengboy avatar Sep 09 '22 01:09 hengboy

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>
    <modules>
        <module>cbrc-log-server</module>
        <module>cbrc-statement-verify-services</module>
    </modules>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.0</version>
    </parent>
    <groupId>com.boczj</groupId>
    <artifactId>api-boot-cbrc</artifactId>
    <version>0.1.0.RELEASE</version>
    <name>api-boot-cbrc</name>
    <properties>
        <java.version>1.8</java.version>
        <api.boot.version>2.3.7</api.boot.version>
        <hutool.version>5.8.5</hutool.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <!--ApiBoot统一版本依赖-->
            <!--版本依赖详细介绍:http://apiboot.minbox.io/zh-cn/docs/version-rely.html-->
            <dependency>
                <groupId>org.minbox.framework</groupId>
                <artifactId>api-boot-dependencies</artifactId>
                <version>${api.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

randeexiong avatar Sep 09 '22 01:09 randeexiong

只有这些吗?你这应该是parent项目的pom.xml,你启动的是哪个module?

hengboy avatar Sep 09 '22 01:09 hengboy

出错问题代码我已上传 github,请查看,谢谢

https://github.com/xiungfi/api-boot-cbrc.git

randeexiong avatar Sep 09 '22 02:09 randeexiong

你可以看下我的博客:https://blog.minbox.org/

hengboy avatar Sep 09 '22 05:09 hengboy

你可以看下我的博客:https://blog.minbox.org/

api-boot-starter-security-oauth-jwt 导致的循环依赖bug,在您博客没看到说有对这个bug的的处理方案

randeexiong avatar Sep 09 '22 11:09 randeexiong