Getting "Server connection lost, trying to reconnect..." message while fetching the data

Hi,

I have a DTO entity screen that contains a Group Table, where I override the loadDelegate method to fetch a list of values using the JDBC template and set them to the data container. However, I encounter a ‘Server connection lost, trying to reconnect…’ message in the top right corner after one minute of fetching; this message sometimes disappears after the data populates, but other times it persists, and the data is not fetched at all. Please find the below screenshot for your reference.

image

Also, I have put the application logging to debug and found that a certain sequence of logs gets printed at the time of issue occurrence. Attaching the logs below, please refer if they are useful. Need assistance in resolving the issue. Thanks in advance.

Logs:

2024-11-04 15:57:35,126 DEBUG o.a.c.DefaultBroadcaster.addAtmosphereResource:1356 - [http-nio-8888-exec-578] Duplicate resource a5de94df-a4c9-4aef-9b28-79ac38892236. Could be caused by a dead connection not detected by your server. Replacing the old one with the fresh one
2024-11-04 15:57:35,128 DEBUG o.a.c.JSR356Endpoint.onError:317 - [http-nio-8888-exec-578] Problem in web socket session
java.io.EOFException: null
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1338)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1226)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:74)
	at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:184)
	at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:164)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:152)
	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:60)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:57)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1786)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
	at java.base/java.lang.Thread.run(Thread.java:834)
2024-11-04 15:57:35,129 DEBUG o.a.c.DefaultBroadcaster.addAtmosphereResource:1356 - [http-nio-8888-exec-595] Duplicate resource a5de94df-a4c9-4aef-9b28-79ac38892236. Could be caused by a dead connection not detected by your server. Replacing the old one with the fresh one
2024-11-04 15:57:35,180 DEBUG o.a.c.AtmosphereResourceImpl.notifyListeners:674 - [http-nio-8888-exec-578] Listener error {}
java.lang.NullPointerException: null
	at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:652)
	at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:630)
	at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:499)
	at org.atmosphere.cpr.AsynchronousProcessor.endRequest(AsynchronousProcessor.java:604)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.executeClose(DefaultWebSocketProcessor.java:710)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.close(DefaultWebSocketProcessor.java:658)
	at org.atmosphere.container.JSR356Endpoint.onClose(JSR356Endpoint.java:310)
	at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:797)
	at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:721)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:256)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:158)
	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:60)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:57)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1786)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
	at java.base/java.lang.Thread.run(Thread.java:834)
2024-11-04 15:57:35,181 ERROR c.v.s.c.PushAtmosphereHandler$AtmosphereResourceListener.onThrowable:115 - [http-nio-8888-exec-578] Exception in push connection
java.lang.NullPointerException: null
	at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:652)
	at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:630)
	at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:499)
	at org.atmosphere.cpr.AsynchronousProcessor.endRequest(AsynchronousProcessor.java:604)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.executeClose(DefaultWebSocketProcessor.java:710)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.close(DefaultWebSocketProcessor.java:658)
	at org.atmosphere.container.JSR356Endpoint.onClose(JSR356Endpoint.java:310)
	at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:797)
	at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:721)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:256)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:158)
	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:60)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:57)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1786)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
	at java.base/java.lang.Thread.run(Thread.java:834)
2024-11-04 15:57:35,181 ERROR c.v.s.c.PushHandler.handleConnectionLost:347 - [http-nio-8888-exec-578] Could not get resource. This should never happen.

Version Details :
Jmix version: 1.5.0
Jmix Studio plugin version: 2.0.0-231

I would recommend using background tasks with a dialog for long fetching, as described in this example.