简体   繁体   中英

Getting Spring Boot Internal Server Error Status 500 for around one minute

I have following spring-boot setup.

建筑学

Any help / pointer will be appreciated. Thanks in advance.

Error In Postman

{ "timestamp": "2021-07-21T07:06:15.840+00:00", "path": "/products/status", "status": 500, "error": "Internal Server Error", "message": "Connection refused: no further information: centos/192.168.0.104:60788", "requestId": "ffb03cbf-22", "trace": "io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: centos/192.168.0.104:60788\\r\\n\\tSuppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: \\nError has been observed at the following site(s):\\n\\t|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]\\n\\t|_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]\\n\\t|_ checkpoint ⇢ HTTP GET "/products/status" [ExceptionHandlingWebHandler]\\nStack trace:\\r\\nCaused by: java.net.ConnectException: Connection refused: no further information\\r\\n\\tat java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)\\r\\n\\tat java .base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)\\r\\n\\tat io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)\\r\\n\\tat io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)\\r\\n\\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)\\r\\n\\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)\\r\\n\\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)\\r\\n\\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)\\r\\n\\tat io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)\\r\\n\\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\\r\\n\\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\\r\\n\\tat java.base/java.lang.Thread.run(Thread.java:834)\\r\\n" }

I mentioned in the original post as follows:

  • I run the applications in following order : Eureka discovery service, API Gateway, Albums

After some thought and R & D, I realized that I need to start Albums before API Gateway . So the final order is Eureka discovery service, Albums, API Gateway.

The reason being as follows :

If I start API Gateway first, then it will not fetch the address of Albums Microservice from Eureka because the Albums Microservice has not started yet.

Just by changing the order solved my problem. As soon as the API gateway start I am able to access the Albums (without having to wait).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM