5

=== 更新 === (见下面的原始帖子)

虽然 zyro 发起的 bug 修复带来了一些改进,但错误仍然没有完全消失。它仍然看起来像这样:

31-Jan-2018 19:30:53.529 INFO [MessageBroker-3] org.apache.coyote.AbstractProcessor.setErrorState An error occurred in processing while o
n a non-container thread. The connection will be closed immediately
 java.io.IOException: APR error: -32
        at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:291)
        at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:244)
        at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:213)
        at org.apache.coyote.http11.AbstractOutputBuffer.flush(AbstractOutputBuffer.java:305)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:765)
        at org.apache.coyote.Response.action(Response.java:177)
        at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:349)
        at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:317)
        at org.apache.catalina.connector.Response.flushBuffer(Response.java:510)
        at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:318)
        at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
        at org.springframework.boot.web.support.ErrorPageFilter$ErrorWrapperResponse.flushBuffer(ErrorPageFilter.java:318)
        at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
        at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
        at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
        at org.springframework.security.web.util.OnCommittedResponseWrapper.flushBuffer(OnCommittedResponseWrapper.java:159)
        at org.springframework.http.server.ServletServerHttpResponse.flush(ServletServerHttpResponse.java:96)
        at org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.writeFrameInternal(AbstractHttpSockJsSession
.java:350)
        at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:318)
        at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:251)
        at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$HeartbeatTask.run(AbstractSockJsSession.java:455
)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

所以实际上只有错误的第二部分消失了......

=== 原始帖子 ===

我在 Tomcat 8.0.28 catalina.out 日志中发现了很多错误。我猜这是由我使用的 websocket 插件引起的。我在如下服务类中进行了实现:

def publishNewChart(def productId) {
        def linechart = chartService.getLinechart(Product.load(productId));

        brokerMessagingTemplate.convertAndSend("/topic/trade_chart/" + productId, linechart);
    }

在客户端以下:

$(function() {
        var socket = new SockJS("${createLink(uri: '/stomp')}");
        var client = Stomp.over(socket);

        client.connect({}, function() {

            client.subscribe("/topic/trade_chart/${product?.id}", function(message) {
                var messageJson = $.parseJSON(message.body);
                refreshPriceChart($.parseJSON(messageJson.data));
                brushed();     
            });
        });
    });

有没有人知道错误来自哪里以及如何处理它们?

提前感谢日志!

2017 年 3 月 2 日 13:15:33.349 INFO [MessageBroker-4] org.apache.coyote.AbstractProcessor.setErrorState 在非容器线程上处理时发生错误。连接将立即关闭 java.io.IOException: APR 错误: -32 at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:291) at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer .java:244) 在 org.apache.coyote.http11.AbstractOutputBuffer.flush(AbstractOutputBuffer.java:305) 在 org.apache.coyote. http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:765) 在 org.apache.coyote.Response.action(Response.java:177) 在 org.apache.catalina。

错误 org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler - 计划任务中发生意外错误。org.springframework.web.socket.sockjs.SockJsTransportFailureException: 无法写入 SockJsFrame 内容='h'; 嵌套异常是 o rg.apache.catalina.connector.ClientAbortException: java.io.IOException: APR 错误: -32 at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:339)在 org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:255) 在 org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$HeartbeatTask.run(AbstractSockJsSession.java : 451) 在 org.springframework.scheduling.support.DelegatingErrorHandlingRunnable。

4

0 回答 0