The error contents are as follows:
error on GET request for "http://localhost:8761/eureka/apps/": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect stacktrace=org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/eureka/apps/": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:785)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
...
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
...
2022-01-08 22:16:56.800 WARN 15304 --- [ main] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: I/O error on GET request for "http://localhost:8761/eureka/apps/": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2022-01-08 22:16:56.801 INFO 15304 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/windows10.microdone.cn - was unable to refresh its cache! This periodic background refresh will be retried in 30 seconds. status = Cannot execute request on any known server stacktrace = com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
......
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.configClientController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'config.info' in value "${config.info}"
2022-01-08 22:16:57.016 INFO 15304 --- [ main] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2022-01-08 22:16:57.847 INFO 15304 --- [nfoReplicator-0] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}, exception=I/O error on POST request for "http://localhost:8761/eureka/apps/UNKNOWN": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect stacktrace=org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://localhost:8761/eureka/apps/UNKNOWN": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
......
2022-01-08 22:16:57.847 WARN 15304 --- [nfoReplicator-0] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: I/O error on POST request for "http://localhost:8761/eureka/apps/UNKNOWN": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2022-01-08 22:16:57.849 WARN 15304 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/windows10.microdone.cn - registration failed Cannot execute request on any known server
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
......
2022-01-08 22:16:57.850 WARN 15304 --- [nfoReplicator-0] c.n.discovery.InstanceInfoReplicator : There was a problem with the instance info replicator
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
......
2022-01-08 22:16:57.851 INFO 15304 --- [ main] com.netflix.discovery.DiscoveryClient : Unregistering ...
2022-01-08 22:16:58.855 INFO 15304 --- [ main] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}, exception=I/O error on DELETE request for "http://localhost:8761/eureka/apps/UNKNOWN/windows10.microdone.cn": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect stacktrace=org.springframework.web.client.ResourceAccessException: I/O error on DELETE request for "http://localhost:8761/eureka/apps/UNKNOWN/windows10.microdone.cn": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.cancel(EurekaHttpClientDecorator.java:71)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
......
2022-01-08 22:16:58.855 WARN 15304 --- [ main] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: I/O error on DELETE request for "http://localhost:8761/eureka/apps/UNKNOWN/windows10.microdone.cn": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2022-01-08 22:16:58.856 ERROR 15304 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/windows10.microdone.cn - de-registration failedCannot execute request on any known server
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
......
2022-01-08 22:16:59.013 ERROR 15304 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.configClientController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'config.info' in value "${config.info}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:405) ~[spring-beans-5.3.7.jar:5.3.7]
Cause of problem:
Because my spring cloud version is too high, I lack related dependencies.
Solution:
Add the following dependencies to the spring cloud configuration center client POM file:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>3.1.0</version>
</dependency>
To illustrate, my spring cloud is version 2020.0.1, and the above dependencies should be added above the spring cloud g version.
Read More:
- [Solved] Eureka related services Start Error: cannot execute request on any known server
- [Solved] Eureka registry service starts error: Request execution error. Endpoint = defaultendpoint
- [Solved] K8s Initialize Error: failed with error: Get “http://localhost:10248/healthz“
- [Solved] Eureka Startup Error: Root name (‘timestamp‘) does not match expected type EurekaApplications
- SpringCloud: gateway module startup error [How to Solve]
- [Solved] Springcloud Add gateway to Startup Error: Exception encountered during context initialization – cancelling refresh
- [Solved] k8s kubeadmin init Error: http://localhost:10248/healthz‘ failed
- Kubernetes Error: Error in configuration: unable to read client-cert* unable to read client-key*
- [Solved] Ubuntu 20.04 LTS Install k8s Error: The connection to the server localhost:8080 was refused
- Tomcat Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors
- POI Export Excel Error: HTTP Status 500 – Request processing failed; nested exception is java.lang.NullPointerException
- [Solved] Chrome Error: The request client is not a secure context
- [Solved] “error_code“:500,“message“:“IO Error trying to forward REST request: java.net.ConnectException: Connection Refused
- [Solved] The version of springcloud must support the current version of springboot, otherwise the startup project will report an error: error starting ApplicationContext
- It can be opened with localhost, but not with IP address. The request host name is invalid
- [Solved] failed to req API:localhost:8848/nacos/v1/ns/instance. code:500 msg: java.net.ConnectException
- [Solved] Nginx Request 500 Error: CreateFile() “/temp/client_body_temp/0000000013” failed (5: Access is denied)
- Spark ERROR client.TransportResponseHandler: Still have 1 requests outstanding when connection from
- Eureka unit test error creating bean with name ‘Eureka autoservice registration’: Singleton bean
- [Solved] kafka startup Error: java.net.ConnectException: Connection refused