-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After disabling Spring Auto Reconfiguration, application is not able to connect to config server(this leads to placeholder resolve problem) #1053
Comments
Can you please share the following?
|
thanks for the reply @pivotal-david-osullivan pom.xml with SCS etc. versions VCAP_SERVICES with the Config Server binding
my analysis(why it is not working) is it's because of removal of connector libraries. From the logs it's clear that my application is not able to locate the real SCS bounded in PCF. (it should not be localhost) do i need to add manual connection configuration via bootstrap.yml file something like below. or any extra libraries along with java-cfenv i need to add it in pom file spring: if it is our SCS is protected with oauth2.0. any reference for the same. |
By SCS I am referring to Spring Cloud Services - do you still have client libraries for use with SCS as well as Spring Cloud versions in your pom? |
sorry for the confusion yes we have some, below are the ones.
|
We have a spring boot application that is deployed in PCF and works fine until we tried to migrate it to java-cfenv-boot library by following the migration guide and removing the dependencies it suggests. However, we encounter a problem with the centralized configuration. The application fails to get the placeholder values from the Spring Cloud Config Server (bound to PCF).
This is the error we get: [OUT] Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘some.value’ in value “${some.value}”
removed
org.springframework.boot:spring-boot-starter-cloud-connectors
or
org.springframework.cloud:spring-cloud-core
org.springframework.cloud:spring-cloud-connectors-core
org.springframework.cloud:spring-cloud-cloudfoundry-connector
org.springframework.cloud:spring-cloud-spring-service-connector dependencies from pom file
added
io.pivotal.cfenv java-cfenv-boot 2.4.0 dependency
spring.profiles.active: dev,cloud
JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}'
Application couldn't able to locate the real config server and it is fall back to localhost
024-02-08T17:22:22.762+05:30 [APP/PROC/WEB/0] [OUT] 2024-02-08 11:52:22.761 INFO 8 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888/
2024-02-08T17:22:22.892+05:30 [APP/PROC/WEB/0] [OUT] 2024-02-08 11:52:22.892 WARN 8 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/application/dev,cloud": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
2024-02-08T17:22:22.895+05:30 [APP/PROC/WEB/0] [OUT] 2024-02-08 11:52:22.895 INFO 8 --- [ main] c.t.a.s.migration.Application : The following profiles are active: dev,cloud
without removing the above dependencies below are the logs
2024-01-25T12:52:52.305+05:30 [APP/PROC/WEB/0] [OUT] 2024-01-25 07:22:52.305 INFO 7 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: https://config-server-11121121a-fdec-4ba5-c654-5ccff667744.apps.np.app.com/
2024-01-25T12:52:54.122+05:30 [APP/PROC/WEB/0] [OUT] 2024-01-25 07:22:54.122 INFO 7 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource {name='credhub-app-dev-master'}, MapPropertySource {name='credhub-app-dev-master'}, MapPropertySource {name='ssh://[email protected]:22/var/vcap/store/mirror/8475euhfjy348573857rjhgdfjh745647/davinci-config/davinci-app-dev.properties'}, MapPropertySource {name='ssh://[email protected]:22/var/vcap/store/mirror/8475euhfjy348573857rjhgdfjh745647/davinci-config/application.properties'}]]
please help us why after removing recommended dependencies from the documentation application is not able to locate the real config server.
The text was updated successfully, but these errors were encountered: