**java.net.ConnectException: Connection refused: connect**

原因

微服务中,我依赖的那个服务没有启动(QAQ !!! 从昨晚开始到现在,我也是对自己无语了,最怕开始遇到坑,结果还是坑了自己)

2024-01-22 20:47:48.705 ERROR 25196 --- [nio-9100-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://127.0.0.1:9000/product/query/1": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect] with root cause

java.net.ConnectException: Connection refused: connect
	at java.base/java.net.PlainSocketImpl.connect0(Native Method) ~[na:na]
	at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101) ~[na:na]
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:608) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:557) ~[na:na]
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:508) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:276) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:375) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:396) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1253) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015) ~[na:na]
	at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE]

你可能感兴趣的:(spring,Cloud,java,开发语言)