开发者社区 > 通义灵码 > AI编码助手 > 正文

一直报这个错误,已经好几次了,还有就是代码经常提示不全

已解决

WebSocket encountered error

java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:327)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:262)
at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:816)
at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:739)
at org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:367)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:296)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:95)
at org.apache.tomcat.websocket.WsFrameClient.resumeProcessing(WsFrameClient.java:212)
at org.apache.tomcat.websocket.WsFrameClient.access$500(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.doResumeProcessing(WsFrameClient.java:189)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:163)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:148)
at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:129)
at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:284)
at java.base/sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.completed(WindowsAsynchronousSocketChannelImpl.java:586)
at java.base/sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:387)
at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:113)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at java.base/sun.nio.ch.PendingFuture.get(PendingFuture.java:200)
at org.apache.tomcat.websocket.WsRemoteEndpointImplClient.doWrite(WsRemoteEndpointImplClient.java:62)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$OutputBufferSendHandler.write(WsRemoteEndpointImplBase.java:952)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$OutputBufferSendHandler.onResult(WsRemoteEndpointImplBase.java:967)
at org.apache.tomcat.websocket.WsRemoteEndpointImplClient.doWrite(WsRemoteEndpointImplClient.java:68)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$OutputBufferSendHandler.write(WsRemoteEndpointImplBase.java:909)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:509)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:314)
... 20 more
Caused by: java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at java.base/sun.nio.ch.WindowsAsynchronousSocketChannelImpl.write0(Native Method)
at java.base/sun.nio.ch.WindowsAsynchronousSocketChannelImpl$WriteTask.run(WindowsAsynchronousSocketChannelImpl.java:784)
at java.base/sun.nio.ch.WindowsAsynchronousSocketChannelImpl.implWrite(WindowsAsynchronousSocketChannelImpl.java:920)
at java.base/sun.nio.ch.AsynchronousSocketChannelImpl.write(AsynchronousSocketChannelImpl.java:382)
at java.base/sun.nio.ch.AsynchronousSocketChannelImpl.write(AsynchronousSocketChannelImpl.java:387)
at org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure.write(AsyncChannelWrapperNonSecure.java:58)
... 27 more

展开
收起
zhaowang 2024-01-12 10:50:32 95 0
2 条回答
写回答
取消 提交回答
  • 欢迎使用通义灵码:https://tongyi.aliyun.com/lingma/
    官方回答

    这个看起来貌似不一定和灵码有直接关联,不知道有没有必现的路径。

    2024-01-18 16:23:50
    赞同 展开评论 打赏
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    这个错误是由于远程主机强制关闭了一个现有的连接导致的。你可以尝试以下方法解决这个问题:

    1. 检查你的网络连接是否正常,确保没有防火墙或代理服务器阻止了连接。
    2. 尝试重启你的计算机和Tomcat服务器,看是否能解决问题。
    3. 如果问题仍然存在,可以考虑在Tomcat的配置文件中增加一些参数,例如maxConnectionsconnectionTimeout等,以提高连接的稳定性。
    2024-01-12 21:45:02
    赞同 展开评论 打赏

基于通义大模型的 AI 编码辅助工具,支持代码智能生成、单元测试生成、问题排查、研发智能问答等功能,为开发者带来高效、流畅的编码体验。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载