将应用程序加载到PCF时面对问题



bean方法'configServicePropertySource'S in'configServiceBootStrapConfiguration'未加载,因为@conditionalonproperty(spring.cloud.config.enabled)在属性中发现了不同的值。 。

- 当我试图将其加载到PCF中时,我会收到上述消息。但是当本地运行时,它正在按预期工作。

当此错误消息出现在Spring Boot 2.01/Pivotal Cloud Foundry/groovy/gradle环境中时,我注意到的另一件事是,当我删除春季依赖关系时,问题就消失了正在开发的基于启动的模块。

修复程序是更改导入模块的构建。

这样,

    compileOnly('org.springframework.boot:spring-boot-starter')
    compileOnly('org.springframework.boot:spring-boot-starter-amqp')
    compileOnly('org.springframework.cloud:spring-cloud-config-server')
    compileOnly('org.springframework.boot:spring-boot-configuration-processor')
    testCompile('org.springframework.boot:spring-boot-starter')
    testCompile('org.springframework.boot:spring-boot-starter-amqp')
    testCompile('org.springframework.cloud:spring-cloud-config-server')

而不是

    compile('org.springframework.boot:spring-boot-starter')
    compile('org.springframework.boot:spring-boot-starter-amqp')
    compile('org.springframework.cloud:spring-cloud-config-server')
    compile('org.springframework.boot:spring-boot-configuration-processor')

我的理论是,环境中弹簧靴框架的多个实例之间存在冲突,这删除了其中一个,但我不确定这是否正确。

这是我环境中的完整错误消息:

***************************
APPLICATION FAILED TO START
Description:
Parameter 1 of constructor in io.pivotal.spring.cloud.service.config.ConfigClientOAuth2BootstrapConfiguration$ConfigClientOAuth2Configurer required a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' that could not be found.
- Bean method 'configServicePropertySource' in 'ConfigServiceBootstrapConfiguration' not loaded because @ConditionalOnProperty (spring.cloud.config.enabled) found different value in property 'spring.cloud.config.enabled'
Action:
Consider revisiting the conditions above or defining a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' in your configuration.

在对弹簧启动模块的不同组合进行故障排除时,我也看到了此错误,我认为这有相同的原因:

***************************
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in io.pivotal.spring.cloud.service.config.VaultTokenRenewalAutoConfiguration required a bean of type 'io.pivotal.spring.cloud.service.config.ConfigClientOAuth2ResourceDetails' that could not be found.
[OUT] Action:
[OUT] Consider defining a bean of type 'io.pivotal.spring.cloud.service.config.ConfigClientOAuth2ResourceDetails' in your configuration.

最新更新