io.netty.channel.AbstractChannel$AnnotatedConnectException Connection refused no further information

io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /192.168.2.123:8848

在做商品甄选项目时候,配置了网关,代码写的都是一样,但是在请求时候就是会报以下错误。

排查了很久,我以为nacos可以在配置文件中单独写端口号,后来发现并不是。

我的nacos版本是v2.2.2

[ERROR] org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler [48d40e6a]  500 Server Error for HTTP GET "/api/product/category/findCategoryTree"
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /192.168.2.123:8848
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	*__checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ com.alibaba.csp.sentinel.adapter.spring.webflux.SentinelWebFluxFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ HTTP GET "/api/product/category/findCategoryTree" [ExceptionHandlingWebHandler]
Original Stack Trace:
Caused by: java.net.ConnectException: Connection refused: no further information
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:840)

只需要将这个

io.netty.channel.AbstractChannel$AnnotatedConnectException Connection refused no further information_第1张图片

改成这个就好了

io.netty.channel.AbstractChannel$AnnotatedConnectException Connection refused no further information_第2张图片

你可能感兴趣的:(java,java,spring,boot,后端,spring,jwt)