question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

spring-boot-devtools RemoteSpringApplication start fails if failFast=true for spring-cloud-config

See original GitHub issue

The spring-boot app I want to remotely debug uses spring-cloud-config, so it has a bootstrap.yml with

spring.cloud.config.uri=${vcap.services.configService.credentials.uri:http://localhost:8888}
spring.cloud.config.failFast=true

The latter failFast=true causes the startup of spring-boot-devtools SpringRemoteApplication to crash on startup, as (I guess spring-cloud-config client autoreconfiguration) tries to connect to localhost:8888 where nothing is answering as I just want to start the http tunnel to my cloudfoundry app.

Could not locate PropertySource and the fail fast property is set, failing
I/O error on GET request for "http://localhost:8888/logchange-debug/default/master":Connection refused; nested exception is java.net.ConnectException: Connection refused

I don’t know how you can determine, if SpringRemoteApplication is started or “a real” spring boot app, but developer experience is quite bad if you’d have to tweak the failFast property every time you want to start the http debug tunnel.

  .   ____          _                                              __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _          ___               _      \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` |        | _ \___ _ __  ___| |_ ___ \ \ \ \
 \\/  ___)| |_)| | | | | || (_| []::::::[]   / -_) '  \/ _ \  _/ -_) ) ) ) )
  '  |____| .__|_| |_|_| |_\__, |        |_|_\___|_|_|_\___/\__\___|/ / / /
 =========|_|==============|___/===================================/_/_/_/
 :: Spring Boot Remote ::  (v1.3.0.M5)

2015-09-08 18:58:42.993  INFO 7808 --- [           main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/Users/hoffmd9/DBs/git/remoteDebugTest/bin/, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/1.3.0.M5/7a1b7f527145fa9def778daed5a358249ce6da8/spring-boot-starter-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-actuator/1.3.0.M5/d78516c3e33d6936c3385333300046da3e890c20/spring-boot-starter-actuator-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-ws/1.3.0.M5/833e225488e6febb7bd1901430d98ce585e2a893/spring-boot-starter-ws-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-config/1.0.3.RELEASE/9a3aef3b6676efec6cc3e8c6964d3fc4a23512ab/spring-cloud-starter-config-1.0.3.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-devtools/1.3.0.M5/fc43bbfbc407c87ddb770232b80d0a2c09e7531d/spring-boot-devtools-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-test/1.2.5.RELEASE/c97f216162b0ea3a8e4e1041f76be67703756640/spring-boot-starter-test-1.2.5.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/1.3.0.M5/b6daaaf8b53d34710f7cd1c3bbd695d79134bc10/spring-boot-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/1.3.0.M5/9f49e138647bd4702704dfe1ee101f3221cc4795/spring-boot-autoconfigure-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-logging/1.3.0.M5/b143232d29b5dd3c916bcb4fd8968eabc4a5587b/spring-boot-starter-logging-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/4.2.1.RELEASE/97a7ff5ec8a070722d0809098a9964347130466c/spring-core-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.16/d64fb662c9e42789149f5078a62a22edda786c6a/snakeyaml-1.16.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-actuator/1.3.0.M5/eea7830f2d68e88abfdbc044c6205b56b43b6d90/spring-boot-actuator-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.3.0.M5/468a7922720561291f514396a31ab105d9252f1a/spring-boot-starter-web-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jms/4.2.1.RELEASE/456c624719abe1393865b69a1e807be00394091e/spring-jms-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-oxm/4.2.1.RELEASE/327df2a0b268a838492d9a15d015f0495debf42b/spring-oxm-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.ws/spring-ws-core/2.2.2.RELEASE/209d6cb63ae39e1accb701c8328f5cb0af69cde8/spring-ws-core-2.2.2.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.ws/spring-ws-support/2.2.2.RELEASE/bee5fc093a5eeebc2d0c06f2091f03dcd591c312/spring-ws-support-2.2.2.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter/1.0.3.RELEASE/67d67603ff5653833c0d79a6d03c8b75aaf691c/spring-cloud-starter-1.0.3.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-config-client/1.0.2.RELEASE/5a86226bfb2ee6ab814ff27e4a6924ec225a9068/spring-cloud-config-client-1.0.2.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/1.10.19/e8546f5bef4e061d8dd73895b4e8f40e3fe6effe/mockito-core-1.10.19.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/1.3/4785a3c21320980282f9f33d0d1264a69040538f/hamcrest-library-1.3.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-test/4.1.7.RELEASE/5953f9c4cf1d4ddf323cd6caf60daf33f1abafc3/spring-test-4.1.7.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/4.2.1.RELEASE/5bf6dec08e77755c2ec913fde1b8e29083e70a76/spring-context-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.3/d90276fff414f06cb375f2057f6778cd63c6082f/logback-classic-1.1.3.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.12/adef7a9e1263298255fdb5cb107ff171d07c82f3/jcl-over-slf4j-1.7.12.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.12/8811e2e9ab9055e557598dc9aedc64fd43e0ab20/jul-to-slf4j-1.7.12.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.slf4j/log4j-over-slf4j/1.7.12/d2444c9c7c1923304c25f86c5ee83a79a8166205/log4j-over-slf4j-1.7.12.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-tomcat/1.3.0.M5/1a3d29789bdf3ce3421c879a8bea844e73d66a5f/spring-boot-starter-tomcat-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-validation/1.3.0.M5/c46d958e7f3091596d9e87cb0d9a08445c473863/spring-boot-starter-validation-1.3.0.M5.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/4.2.1.RELEASE/e37e34274768989bae9470b6eaffe51e09bd1e44/spring-web-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/4.2.1.RELEASE/6f8db100285e16eff3e413d2fba4f3557c09a07a/spring-webmvc-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/4.2.1.RELEASE/e5e199d175497a895dcdc7e3531e32fea6fbbbee/spring-aop-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/4.2.1.RELEASE/6d39786b9f7b2a79897a0a83495f30002d9f8de3/spring-beans-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-messaging/4.2.1.RELEASE/ee93f4eabc91fd8b496ccdae9df1b515e83f91a8/spring-messaging-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/4.2.1.RELEASE/f05b4465be1aab3493e83cb529f191cb7834b222/spring-tx-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.ws/spring-xml/2.2.2.RELEASE/940f13a04ea9630e817bc8d0034734bf4579dcc4/spring-xml-2.2.2.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-context/1.0.2.RELEASE/78ec031e78d66f28af261de43fa8921d074c7441/spring-cloud-context-1.0.2.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-commons/1.0.2.RELEASE/9a6358910c6e11cc703d77043922c229b2bb43fa/spring-cloud-commons-1.0.2.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/2.1/87c0ea803b69252868d09308b4618f766f135a96/objenesis-2.1.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/4.2.1.RELEASE/f6f34581b94a03bf39c5c88d1286bee76afe90a7/spring-expression-4.2.1.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.1.3/e3c02049f2dbbc764681b40094ecf0dcbc99b157/logback-core-1.1.3.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/8.0.26/33a945c55939d39c5b3f5f5ce91e7d16bc6116e8/tomcat-embed-core-8.0.26.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/8.0.26/8b090d3dccb292b83c03b990f109bf5ceace50ca/tomcat-embed-el-8.0.26.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-logging-juli/8.0.26/9d55e3b1751b1ddacf3b5108b4ec9fcaee380fba/tomcat-embed-logging-juli-8.0.26.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/8.0.26/83628f454a82ee1d33daaa1d53e635405e4c12c3/tomcat-embed-websocket-8.0.26.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-validator/5.2.1.Final/1fcfc403faebd279582fb047dfaedcffe40d8337/hibernate-validator-5.2.1.Final.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.springframework.security/spring-security-crypto/3.2.7.RELEASE/50f61116a5f96c443261cc27dd171edc936d3a1e/spring-security-crypto-3.2.7.RELEASE.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.1.0.Final/8613ae82954779d518631e05daa73a6a954817d5/validation-api-1.1.0.Final.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.jboss.logging/jboss-logging/3.2.1.Final/fedf11b3d4665a434b554a5891fe7f208f029f45/jboss-logging-3.2.1.Final.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/com.fasterxml/classmate/1.1.0/dbbd699a1486ad0f2ed6f5af6cfed66acacb9056/classmate-1.1.0.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.6.1/45c37a03be19f3e0db825fd7814d0bbec40b9e0/jackson-databind-2.6.1.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.6.0/a0990e2e812ac6639b6ce955c91b13228500476e/jackson-annotations-2.6.0.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.6.1/892d15011456ea3563319b27bdd612dbc89bb776/jackson-core-2.6.1.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/aopalliance/aopalliance/1.0/235ba8b489512805ac13a8f9ea77a1ca5ebe3e8/aopalliance-1.0.jar, file:/Users/hoffmd9/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.12/8e20852d05222dc286bf1c71d78d0531e177c317/slf4j-api-1.7.12.jar]
2015-09-08 18:58:42.997 ERROR 7808 --- [           main] o.s.boot.SpringApplication               : Application startup failed
java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_51]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) ~[na:1.8.0_51]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_51]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_51]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_51]
    at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_51]
    at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_51]
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[na:1.8.0_51]
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[na:1.8.0_51]
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[na:1.8.0_51]
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) ~[na:1.8.0_51]
    at sun.net.www.http.HttpClient.New(HttpClient.java:308) ~[na:1.8.0_51]
    at sun.net.www.http.HttpClient.New(HttpClient.java:326) ~[na:1.8.0_51]
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1168) ~[na:1.8.0_51]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104) ~[na:1.8.0_51]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998) ~[na:1.8.0_51]
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932) ~[na:1.8.0_51]
    at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:80) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:596) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    ... 10 common frames omitted
Wrapped by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/remoteDebugTest/default":Connection refused; nested exception is java.net.ConnectException: Connection refused
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:607) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475) ~[spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:120) ~[spring-cloud-config-client-1.0.2.RELEASE.jar:1.0.2.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:79) ~[spring-cloud-config-client-1.0.2.RELEASE.jar:1.0.2.RELEASE]
    ... 6 common frames omitted
Wrapped by: java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:103) ~[spring-cloud-config-client-1.0.2.RELEASE.jar:1.0.2.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:85) ~[spring-cloud-context-1.0.2.RELEASE.jar:1.0.2.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:562) ~[spring-boot-1.3.0.M5.jar:1.3.0.M5]
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:324) ~[spring-boot-1.3.0.M5.jar:1.3.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:273) ~[spring-boot-1.3.0.M5.jar:1.3.0.M5]
    at org.springframework.boot.devtools.RemoteSpringApplication.run(RemoteSpringApplication.java:47) [spring-boot-devtools-1.3.0.M5.jar:1.3.0.M5]
    at org.springframework.boot.devtools.RemoteSpringApplication.main(RemoteSpringApplication.java:73) [spring-boot-devtools-1.3.0.M5.jar:1.3.0.M5]

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marcingrzejszczakcommented, Jul 13, 2018

Is it still a problem with Finchley.RELEASE?

0reactions
spencergibbcommented, Oct 1, 2018

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fail fast if a Spring application cannot connect to its config server
If this is the desired behavior, set the bootstrap configuration property spring.cloud.config.failFast=true and the client will halt with an ...
Read more >
7. Spring Cloud Config Client
In some cases, you may want to fail startup of a service if it cannot connect to the Config Server. If this is...
Read more >
3 Useful Tips for Developers when using Spring Cloud Config
When your Spring Boot application is loading properties from external sources (Eg. Spring Cloud Config Server), ... spring.cloud.config.fail-fast=true
Read more >
Config Server Provider - Steeltoe Documentation
To gain a better understanding of the Spring Cloud Config Server, ... Once that is done, the application fails to start if problems...
Read more >
Microservices — Centralized Configuration with Spring Cloud
spring.cloud.config.fail-fast=true. Client applications will not run if the above is set to true when the configuration server is not responding.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found