带有踩踏的春季靴可提供httpmessagenotwratible exception

发布于 2025-01-26 14:34:55 字数 657 浏览 3 评论 0原文

我一直在使用Spring Boot和Stomp Server for sockjs作为前端库。间歇性地,我在日志中收到以下消息。

11:10:15.017 [37] [http-nio-8080-exec-7] WARN  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class java.util.LinkedHashMap] with preset Content-Type 'application/javascript;charset=UTF-8']

据我阅读,当控制器中收到错误的内容类型时,就会发生这种情况。但是此数据通过WebSocket出现,所有数据均可使用json.stringify从Frontend中进行字符串,并由@messagempapping partered controller收到。 IAM无法理解为什么发生此错误,是否还有其他原因发生此问题。我已将ActiveMQ用作消息代理。

有人可以向这里可能发生的事情投入一些启示。

I have been using spring boot with stomp server for websocket with sockjs as frontend library. Intermittently I get the following message in the logs.

11:10:15.017 [37] [http-nio-8080-exec-7] WARN  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class java.util.LinkedHashMap] with preset Content-Type 'application/javascript;charset=UTF-8']

As far as I have read this occurs when wrong content type is recieved in controller. But this data comes in through websocket and all the data is made to string using JSON.Stringify from frontend and recieved by @MessageMapping annoted controller. Iam not able to understand why this error occurs , could there be other reasons for this issue to occur. I have used ActiveMQ as the message broker.

Can someone throw some light into what could be happening here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怎会甘心 2025-02-02 14:34:55

我自己想出了这个问题。当Stomp Server尝试将心跳从服务器发送到客户端时,就会发生问题。如果客户端在服务器发送心跳时断开连接,则会发生问题。

I figured out the issue myself. Issue occurs when the stomp server try to send heart beat from server to client. If the client disconnects while the server is sending the heartbeat, the issue occurs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文