首页 > 解决方案 > 在 null 中定义的 bean 'AmazonEc2InstanceDataPropertySourcePostProcessor' 无法注册

问题描述

下面列出的堆栈跟踪。

2020-02-18 07:23:02.056  INFO 1 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2020-02-18 07:23:02.226  INFO 1 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2020-02-18 07:23:02.226  WARN 1 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/application/dockerEE,solrWriterEnabled,writerBatchSize5000,aws_integration3a,commondb,neo,reviewModelIndexingDisabled/aws_integration3a": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
2020-02-18 07:23:02.229  INFO 1 --- [           main] c.j.itemdiscovery.index.Application  : The following profiles are active: dockerEE,solrWriterEnabled,writerBatchSize5000,aws_integration3a,commondb,neo,reviewModelIndexingDisabled
2020-02-18 07:23:03.480  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2020-02-18 07:23:03.510  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 23ms. Found 0 repository interfaces.
2020-02-18 07:23:03.515  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2020-02-18 07:23:03.520  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5ms. Found 0 repository interfaces.
2020-02-18 07:23:03.575  WARN 1 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'AmazonEc2InstanceDataPropertySourcePostProcessor' defined in null: Cannot register bean definition [Generic bean: class [org.springframework.cloud.aws.context.config.AmazonEc2InstanceDataPropertySourcePostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'AmazonEc2InstanceDataPropertySourcePostProcessor': There is already [Generic bean: class [org.springframework.cloud.aws.context.config.AmazonEc2InstanceDataPropertySourcePostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
2020-02-18 07:23:03.589  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-02-18 07:23:03.593 ERROR 1 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

The bean 'AmazonEc2InstanceDataPropertySourcePostProcessor', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
apply plugin: 'application'
apply plugin: 'org.springframework.boot'

configurations {
    compile.exclude module: 'spring-boot-starter-tomcat'
    compile.exclude module: 'slf4j-log4j12'
    compile.exclude module: 'log4j-slf4j-impl'
    compile.exclude module: 'jms-api'
    compile.exclude module: 'tibjms'
    compile.exclude module: 'spring-jms'

    compile.extendsFrom(springBootCommon, springCloudCommon)
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }

    dependencies {
        dependencySet(group: 'org.apache.solr', version: '6.4.1') {
            entry 'solr-solrj'
        }
    }
}

dependencies {
    compile project(':tdm-integration-common')

    compileOnly 'org.projectlombok:lombok'

    testCompile group: 'junit', name: 'junit', version: '4.12'
    testCompile group: 'com.tngtech.java', name: 'junit-dataprovider', version: '1.12.0'
    testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
compileClasspath - Compile classpath for source set 'main'.
+--- project :tdm-integration-common
|    +--- com.dig.platform:cassandra:2.1.16
|    |    +--- com.datastax.dse:dse-java-driver-core:1.8.1
|    |    |    +--- io.netty:netty-handler:4.0.56.Final -> 4.1.36.Final
|    |    |    |    +--- io.netty:netty-common:4.1.36.Final
|    |    |    |    +--- io.netty:netty-buffer:4.1.36.Final
|    |    |    |    |    \--- io.netty:netty-common:4.1.36.Final
|    |    |    |    +--- io.netty:netty-transport:4.1.36.Final
|    |    |    |    |    +--- io.netty:netty-common:4.1.36.Final
|    |    |    |    |    +--- io.netty:netty-buffer:4.1.36.Final (*)
|    |    |    |    |    \--- io.netty:netty-resolver:4.1.36.Final
|    |    |    |    |         \--- io.netty:netty-common:4.1.36.Final
|    |    |    |    \--- io.netty:netty-codec:4.1.36.Final
|    |    |    |         +--- io.netty:netty-common:4.1.36.Final
|    |    |    |         +--- io.netty:netty-buffer:4.1.36.Final (*)
|    |    |    |         \--- io.netty:netty-transport:4.1.36.Final (*)
|    |    |    +--- com.google.guava:guava:19.0
|    |    |    +--- io.dropwizard.metrics:metrics-core:3.2.2 -> 3.1.2
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.7 -> 1.7.26
|    |    |    +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    |    +--- com.github.jnr:jnr-ffi:2.1.7
|    |    |    |    +--- com.github.jnr:jffi:1.2.16
|    |    |    |    +--- org.ow2.asm:asm:5.0.3
|    |    |    |    +--- org.ow2.asm:asm-commons:5.0.3
|    |    |    |    |    \--- org.ow2.asm:asm-tree:5.0.3
|    |    |    |    |         \--- org.ow2.asm:asm:5.0.3
|    |    |    |    +--- org.ow2.asm:asm-analysis:5.0.3
|    |    |    |    |    \--- org.ow2.asm:asm-tree:5.0.3 (*)
|    |    |    |    +--- org.ow2.asm:asm-tree:5.0.3 (*)
|    |    |    |    +--- org.ow2.asm:asm-util:5.0.3
|    |    |    |    |    \--- org.ow2.asm:asm-tree:5.0.3 (*)
|    |    |    |    \--- com.github.jnr:jnr-x86asm:1.0.2
|    |    |    \--- com.github.jnr:jnr-posix:3.0.44
|    |    |         +--- com.github.jnr:jnr-ffi:2.1.7 (*)
|    |    |         \--- com.github.jnr:jnr-constants:0.9.9
|    |    +--- com.google.guava:guava:19.0
|    |    +--- org.springframework.data:spring-data-cassandra:2.1.5.RELEASE -> 2.1.8.RELEASE
|    |    |    +--- org.springframework:spring-context:5.1.7.RELEASE
|    |    |    |    +--- org.springframework:spring-aop:5.1.7.RELEASE
|    |    |    |    |    +--- org.springframework:spring-beans:5.1.7.RELEASE
|    |    |    |    |    |    \--- org.springframework:spring-core:5.1.7.RELEASE
|    |    |    |    |    |         \--- org.springframework:spring-jcl:5.1.7.RELEASE
|    |    |    |    |    \--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    |    +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
|    |    |    |    +--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    |    \--- org.springframework:spring-expression:5.1.7.RELEASE
|    |    |    |         \--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-tx:5.1.7.RELEASE
|    |    |    |    +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
|    |    |    |    \--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-expression:5.1.7.RELEASE (*)
|    |    |    +--- org.springframework.data:spring-data-commons:2.1.8.RELEASE
|    |    |    |    +--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    |    +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.26
|    |    |    \--- org.slf4j:slf4j-api:1.7.26
|    |    \--- org.projectlombok:lombok:1.16.12 -> 1.18.8
|    +--- com.dig.platform:metrics:2.1.16
|    |    +--- org.springframework.boot:spring-boot-starter-actuator:2.1.5.RELEASE
|    |    |    +--- org.springframework.boot:spring-boot-starter:2.1.5.RELEASE
|    |    |    |    +--- org.springframework.boot:spring-boot:2.1.5.RELEASE
|    |    |    |    |    +--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    |    |    \--- org.springframework:spring-context:5.1.7.RELEASE (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.5.RELEASE
|    |    |    |    |    \--- org.springframework.boot:spring-boot:2.1.5.RELEASE (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-starter-logging:2.1.5.RELEASE
|    |    |    |    |    +--- ch.qos.logback:logback-classic:1.2.3
|    |    |    |    |    |    +--- ch.qos.logback:logback-core:1.2.3
|    |    |    |    |    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    |    |    |    +--- org.apache.logging.log4j:log4j-to-slf4j:2.11.2
|    |    |    |    |    |    +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    |    |    |    |    \--- org.apache.logging.log4j:log4j-api:2.11.2
|    |    |    |    |    \--- org.slf4j:jul-to-slf4j:1.7.26
|    |    |    |    |         \--- org.slf4j:slf4j-api:1.7.26
|    |    |    |    +--- javax.annotation:javax.annotation-api:1.3.2
|    |    |    |    \--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.1.5.RELEASE
|    |    |    |    +--- org.springframework.boot:spring-boot-actuator:2.1.5.RELEASE
|    |    |    |    |    \--- org.springframework.boot:spring-boot:2.1.5.RELEASE (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.5.RELEASE (*)
|    |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.9.8
|    |    |    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0
|    |    |    |    |    \--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    |    +--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    |    \--- org.springframework:spring-context:5.1.7.RELEASE (*)
|    |    |    \--- io.micrometer:micrometer-core:1.1.4
|    |    |         +--- org.hdrhistogram:HdrHistogram:2.1.9
|    |    |         \--- org.latencyutils:LatencyUtils:2.0.3
|    |    +--- org.springframework.cloud:spring-cloud-config-client:2.1.1.RELEASE
|    |    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.3.RELEASE -> 2.1.5.RELEASE (*)
|    |    |    +--- org.springframework.cloud:spring-cloud-commons:2.1.1.RELEASE
|    |    |    |    \--- org.springframework.security:spring-security-crypto:5.1.4.RELEASE -> 5.1.5.RELEASE
|    |    |    +--- org.springframework.cloud:spring-cloud-context:2.1.1.RELEASE
|    |    |    |    \--- org.springframework.security:spring-security-crypto:5.1.4.RELEASE -> 5.1.5.RELEASE
|    |    |    +--- org.springframework:spring-web:5.1.5.RELEASE -> 5.1.7.RELEASE
|    |    |    |    +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
|    |    |    |    \--- org.springframework:spring-core:5.1.7.RELEASE (*)
|    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    \--- io.micrometer:micrometer-registry-prometheus:1.1.2 -> 1.1.4
|    |         +--- io.micrometer:micrometer-core:1.1.4 (*)
|    |         \--- io.prometheus:simpleclient_common:0.5.0
|    |              \--- io.prometheus:simpleclient:0.5.0
|    +--- com.dig.platform:feature-logging-logback:1.9.20
|    |    \--- ch.qos.logback:logback-classic:1.1.7 -> 1.2.3 (*)
|    +--- org.springframework:spring-context:5.1.7.RELEASE (*)
|    +--- com.datastax.dse:dse-java-driver-mapping:1.8.1
|    |    +--- com.datastax.dse:dse-java-driver-core:1.8.1 (*)
|    |    +--- com.google.guava:guava:19.0
|    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    +--- com.datastax.dse:dse-java-driver-extras:1.8.1
|    |    +--- com.datastax.dse:dse-java-driver-core:1.8.1 (*)
|    |    \--- com.google.guava:guava:19.0
|    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.6 -> 2.9.8
|    |    +--- org.yaml:snakeyaml:1.23
|    |    \--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    +--- com.fasterxml.jackson.core:jackson-databind:2.8.6 -> 2.9.8 (*)
|    +--- com.fasterxml.jackson.core:jackson-core:2.8.6 -> 2.9.8
|    +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.8.6 -> 2.9.8
|    |    +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.9.8
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    \--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.8
|    |         +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0
|    |         +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |         \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    +--- com.google.code.gson:gson:2.8.0 -> 2.8.5
|    +--- org.json:json:20180130
|    +--- org.apache.cxf:cxf-core:3.1.12
|    |    +--- org.codehaus.woodstox:woodstox-core-asl:4.4.1
|    |    |    \--- org.codehaus.woodstox:stax2-api:3.1.4
|    |    \--- org.apache.ws.xmlschema:xmlschema-core:2.2.2
|    +--- org.apache.cxf:cxf-rt-rs-client:3.1.12
|    |    +--- org.apache.cxf:cxf-rt-transports-http:3.1.12
|    |    |    \--- org.apache.cxf:cxf-core:3.1.12 (*)
|    |    +--- org.apache.cxf:cxf-core:3.1.12 (*)
|    |    \--- org.apache.cxf:cxf-rt-frontend-jaxrs:3.1.12
|    |         +--- org.apache.cxf:cxf-core:3.1.12 (*)
|    |         +--- javax.ws.rs:javax.ws.rs-api:2.0.1
|    |         +--- javax.annotation:javax.annotation-api:1.2 -> 1.3.2
|    |         \--- org.apache.cxf:cxf-rt-transports-http:3.1.12 (*)
|    +--- org.apache.cxf:cxf-rt-transports-http-hc:3.1.12
|    |    +--- org.apache.cxf:cxf-core:3.1.12 (*)
|    |    +--- org.apache.cxf:cxf-rt-transports-http:3.1.12 (*)
|    |    +--- org.slf4j:slf4j-api:1.7.24 -> 1.7.26
|    |    +--- org.slf4j:jcl-over-slf4j:1.7.24 -> 1.7.26
|    |    |    \--- org.slf4j:slf4j-api:1.7.26
|    |    +--- org.apache.httpcomponents:httpcore-nio:4.4.6 -> 4.4.11
|    |    |    \--- org.apache.httpcomponents:httpcore:4.4.11
|    |    \--- org.apache.httpcomponents:httpasyncclient:4.1.3 -> 4.1.4
|    |         +--- org.apache.httpcomponents:httpcore:4.4.10 -> 4.4.11
|    |         +--- org.apache.httpcomponents:httpcore-nio:4.4.10 -> 4.4.11 (*)
|    |         \--- org.apache.httpcomponents:httpclient:4.5.6 -> 4.5.8
|    |              +--- org.apache.httpcomponents:httpcore:4.4.11
|    |              \--- commons-codec:commons-codec:1.11
|    +--- org.apache.cxf:cxf-rt-frontend-jaxrs:3.1.12 (*)
|    +--- com.amazonaws:aws-java-sdk-s3:1.11.180 -> 1.11.415
|    |    +--- com.amazonaws:aws-java-sdk-kms:1.11.415
|    |    |    +--- com.amazonaws:aws-java-sdk-core:1.11.415
|    |    |    |    +--- org.apache.httpcomponents:httpclient:4.5.5 -> 4.5.8 (*)
|    |    |    |    +--- software.amazon.ion:ion-java:1.0.2
|    |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.6.7.1 -> 2.9.8 (*)
|    |    |    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7 -> 2.9.8
|    |    |    |    |    \--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    |    \--- joda-time:joda-time:2.8.1 -> 2.10.2
|    |    |    \--- com.amazonaws:jmespath-java:1.11.415
|    |    |         \--- com.fasterxml.jackson.core:jackson-databind:2.6.7.1 -> 2.9.8 (*)
|    |    +--- com.amazonaws:aws-java-sdk-core:1.11.415 (*)
|    |    \--- com.amazonaws:jmespath-java:1.11.415 (*)
|    +--- com.amazonaws:aws-java-sdk-core:1.11.180 -> 1.11.415 (*)
|    +--- javax.jms:javax.jms-api:2.0.1
|    +--- org.apache.solr:solr-solrj:6.4.1
|    |    +--- commons-io:commons-io:2.5
|    |    +--- org.apache.httpcomponents:httpclient:4.4.1 -> 4.5.8 (*)
|    |    +--- org.apache.httpcomponents:httpcore:4.4.1 -> 4.4.11
|    |    +--- org.apache.httpcomponents:httpmime:4.4.1 -> 4.5.8
|    |    +--- org.apache.zookeeper:zookeeper:3.4.6
|    |    +--- org.codehaus.woodstox:stax2-api:3.1.4
|    |    +--- org.codehaus.woodstox:woodstox-core-asl:4.4.1 (*)
|    |    +--- org.noggit:noggit:0.6
|    |    +--- org.slf4j:jcl-over-slf4j:1.7.7 -> 1.7.26 (*)
|    |    \--- org.slf4j:slf4j-api:1.7.7 -> 1.7.26
|    +--- commons-codec:commons-codec:1.10 -> 1.11
|    +--- commons-io:commons-io:2.5
|    +--- org.apache.commons:commons-lang3:3.9 -> 3.8.1
|    \--- org.hibernate:hibernate-validator:6.0.10.Final
|         \--- org.hibernate.validator:hibernate-validator:6.0.10.Final -> 6.0.16.Final
|              +--- javax.validation:validation-api:2.0.1.Final
|              +--- org.jboss.logging:jboss-logging:3.3.2.Final
|              \--- com.fasterxml:classmate:1.3.4 -> 1.4.0
+--- io.dropwizard.metrics:metrics-core:3.1.2 (*)
+--- org.projectlombok:lombok -> 1.18.8
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.1.5.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-security -> 2.1.5.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.5.RELEASE (*)
|    +--- org.springframework:spring-aop:5.1.7.RELEASE (*)
|    +--- org.springframework.security:spring-security-config:5.1.5.RELEASE
|    |    +--- org.springframework.security:spring-security-core:5.1.5.RELEASE
|    |    |    +--- org.springframework:spring-aop:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-beans:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-context:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-core:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    |    \--- org.springframework:spring-expression:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    +--- org.springframework:spring-aop:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    +--- org.springframework:spring-beans:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    +--- org.springframework:spring-context:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    |    \--- org.springframework:spring-core:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|    \--- org.springframework.security:spring-security-web:5.1.5.RELEASE
|         +--- org.springframework.security:spring-security-core:5.1.5.RELEASE (*)
|         +--- org.springframework:spring-aop:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|         +--- org.springframework:spring-beans:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|         +--- org.springframework:spring-context:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|         +--- org.springframework:spring-core:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|         +--- org.springframework:spring-expression:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
|         \--- org.springframework:spring-web:5.1.6.RELEASE -> 5.1.7.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-web -> 2.1.5.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.5.RELEASE (*)
|    +--- org.springframework.boot:spring-boot-starter-json:2.1.5.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:2.1.5.RELEASE (*)
|    |    +--- org.springframework:spring-web:5.1.7.RELEASE (*)
|    |    +--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8
|    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8
|    |         +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |         \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    +--- org.hibernate.validator:hibernate-validator:6.0.16.Final (*)
|    +--- org.springframework:spring-web:5.1.7.RELEASE (*)
|    \--- org.springframework:spring-webmvc:5.1.7.RELEASE
|         +--- org.springframework:spring-aop:5.1.7.RELEASE (*)
|         +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
|         +--- org.springframework:spring-context:5.1.7.RELEASE (*)
|         +--- org.springframework:spring-core:5.1.7.RELEASE (*)
|         +--- org.springframework:spring-expression:5.1.7.RELEASE (*)
|         \--- org.springframework:spring-web:5.1.7.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-aop -> 2.1.5.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.5.RELEASE (*)
|    +--- org.springframework:spring-aop:5.1.7.RELEASE (*)
|    \--- org.aspectj:aspectjweaver:1.9.4
+--- org.springframework.cloud:spring-cloud-config-client -> 2.1.1.RELEASE (*)
+--- org.springframework.cloud:spring-cloud-starter-netflix-eureka-client -> 2.1.1.RELEASE
|    +--- org.springframework.cloud:spring-cloud-starter:2.1.1.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:2.1.3.RELEASE -> 2.1.5.RELEASE (*)
|    |    +--- org.springframework.cloud:spring-cloud-context:2.1.1.RELEASE (*)
|    |    +--- org.springframework.cloud:spring-cloud-commons:2.1.1.RELEASE (*)
|    |    \--- org.springframework.security:spring-security-rsa:1.0.7.RELEASE
|    |         \--- org.bouncycastle:bcpkix-jdk15on:1.60
|    |              \--- org.bouncycastle:bcprov-jdk15on:1.60
|    +--- org.springframework.cloud:spring-cloud-netflix-hystrix:2.1.1.RELEASE
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.3.RELEASE -> 2.1.5.RELEASE (*)
|    |    \--- org.springframework.boot:spring-boot-starter-aop:2.1.3.RELEASE -> 2.1.5.RELEASE (*)
|    +--- org.springframework.cloud:spring-cloud-netflix-eureka-client:2.1.1.RELEASE
|    |    \--- org.springframework.cloud:spring-cloud-netflix-hystrix:2.1.1.RELEASE (*)
|    +--- com.netflix.eureka:eureka-client:1.9.8
|    +--- com.netflix.eureka:eureka-core:1.9.8
|    +--- org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.1.1.RELEASE
|    |    +--- org.springframework.cloud:spring-cloud-starter:2.1.1.RELEASE (*)
|    |    +--- org.springframework.cloud:spring-cloud-netflix-ribbon:2.1.1.RELEASE
|    |    |    \--- org.springframework.cloud:spring-cloud-netflix-archaius:2.1.1.RELEASE
|    |    +--- org.springframework.cloud:spring-cloud-netflix-archaius:2.1.1.RELEASE
|    |    +--- com.netflix.archaius:archaius-core:0.7.6
|    |    \--- commons-configuration:commons-configuration:1.8
|    |         \--- commons-lang:commons-lang:2.6
|    +--- org.springframework.cloud:spring-cloud-starter-netflix-ribbon:2.1.1.RELEASE
|    |    +--- org.springframework.cloud:spring-cloud-starter:2.1.1.RELEASE (*)
|    |    +--- org.springframework.cloud:spring-cloud-netflix-ribbon:2.1.1.RELEASE (*)
|    |    +--- org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.1.1.RELEASE (*)
|    |    +--- com.netflix.ribbon:ribbon:2.3.0
|    |    +--- com.netflix.ribbon:ribbon-core:2.3.0
|    |    +--- com.netflix.ribbon:ribbon-httpclient:2.3.0
|    |    +--- com.netflix.ribbon:ribbon-loadbalancer:2.3.0
|    |    \--- io.reactivex:rxjava:1.2.0
|    +--- com.netflix.ribbon:ribbon-eureka:2.3.0
|    \--- com.thoughtworks.xstream:xstream:1.4.10
|         +--- xmlpull:xmlpull:1.1.3.1
|         \--- xpp3:xpp3_min:1.1.4c
+--- org.springframework.cloud:spring-cloud-aws-autoconfigure -> 2.1.1.RELEASE
|    +--- org.springframework.cloud:spring-cloud-aws-context:2.1.1.RELEASE
|    |    +--- org.springframework.cloud:spring-cloud-aws-core:2.1.1.RELEASE
|    |    |    +--- org.springframework:spring-beans:5.1.5.RELEASE -> 5.1.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-aop:5.1.5.RELEASE -> 5.1.7.RELEASE (*)
|    |    |    +--- com.amazonaws:aws-java-sdk-core:1.11.415 (*)
|    |    |    +--- com.amazonaws:aws-java-sdk-s3:1.11.415 (*)
|    |    |    +--- com.amazonaws:aws-java-sdk-ec2:1.11.415
|    |    |    |    +--- com.amazonaws:aws-java-sdk-core:1.11.415 (*)
|    |    |    |    \--- com.amazonaws:jmespath-java:1.11.415 (*)
|    |    |    +--- com.amazonaws:aws-java-sdk-cloudformation:1.11.415
|    |    |    |    +--- com.amazonaws:aws-java-sdk-core:1.11.415 (*)
|    |    |    |    \--- com.amazonaws:jmespath-java:1.11.415 (*)
|    |    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    +--- org.springframework:spring-context:5.1.5.RELEASE -> 5.1.7.RELEASE (*)
|    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.3.RELEASE -> 2.1.5.RELEASE (*)
|    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
\--- org.springframework.cloud:spring-cloud-starter-aws -> 2.1.1.RELEASE
     +--- org.springframework.cloud:spring-cloud-aws-context:2.1.1.RELEASE (*)
     +--- org.springframework.cloud:spring-cloud-aws-autoconfigure:2.1.1.RELEASE (*)
     \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26

看起来我的依赖项与 spring 和 spring boot 重叠,因为有些项目使用 Spring,例如,构建一个 Rest API,有些项目使用 Spring Boot 进行命令行应用程序。

标签: amazon-web-servicesspring-bootamazon-s3amazon-ec2

解决方案


发生这种情况是因为您已经在类路径上有spring-cloud-aws-autoconfigurejar,其中包含spring.facories自动加载 AWS 相关 bean(自动配置)。当您在项目注释中使用@EnableContextInstanceData它时,它会导致第二次加载相同的配置。


推荐阅读