我的应用程序中有 2 个线程 - 服务器(主)和服务,它们通知用户坐标变化。所以当页面重新加载时我有错误:
Exception in thread "Timer-1" org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSING], expecting [OPEN or CONNECTED]
at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:252)
at service.MyService.run(MyService.java:67)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
和线程关闭。
如何解决?