Tomcat 在 7.0.27 版本之后不进行 blazeds 流传输? [英] Tomcat doesn't do blazeds streaming after version 7.0.27?

查看:26
本文介绍了Tomcat 在 7.0.27 版本之后不进行 blazeds 流传输?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现我的 flex 应用程序在 tomcat 版本 $subject 之后不再工作了.请帮我解决这个问题.我尝试了很多事情都没有成功.

这是我的配置.

烈焰 - 4.xTomcat - 最新 - 7.0.32爪哇 7

应用程序只是挂起,没有任何错误或任何事情.它从 7.0.32 再次运行.我检查了 tomcat 发行说明(http://tomcat.apache.org/tomcat-7.0-doc/changelog.html) 并将问题隔离到 Coyote jar 文件.

当我将 Coyote.jar 从版本 7.0.27 替换为 7.0.32 时,它可以正常工作.

以下是 Coyote 的更改(http://tomcat.apache.org/tomcat-7.0-doc/changelog.html)

52858:正确修复高 CPU 负载 (fhanik)53138:7.0.27 中引入的 SSL 上的损坏的 Sendfile (fhanik)52055:需要额外的修复来确保 InputFilters 在请求之间被回收.(市场)53061:修复了 NIO 连接器中的一个问题,如果轮询器处于低但一致的负载(> 1 个请求/每秒,并且请求之间始终小于 1 秒)超时从未发生.(市场)53063:当使用带有 BIO 的 Executor 时,使用 executor 的 maxThreads 作为 maxConnections 的默认值.(市场)53119:防止在使用 APR/本机连接器从 AJP 连接完全写入响应之前客户端断开连接时报告缓冲区溢出错误.(市场)53169:允许开发人员通过设置 Connection: close 标头来避免对未知长度的响应进行分块编码.基于 Philippe Marschall 建议的补丁.(市场)53173:正确倒计时 maxConnections (fhanik)更新 NIO 连接器的 pollerThreadCount 的默认值.无论可用的处理器如何,新的默认值都不会超过 2.(范尼克)允许通过来自端点的 getter 并作为 ThreadPool mbean 的 JMX 属性检索当前 connectionCount.(荣)更正了当 Tomcat 连接器停止时 Comet END 事件未发送到连接的客户端的边缘情况.(市场)53406:修复使用 Comet 时连接关闭时可能出现的堆栈溢出.(范尼克)改进 InternalNioInputBuffer.parseHeaders().(科林科)在连接器上实现 maxHeaderCount 属性.它相当于 Apache HTTPD 的 LimitRequestFields 指令.默认值为 100. (kkolinko)

任何猜测/想法都会有所帮助.提前致谢!

解决方案

我认为这可能是问题的原因:

<前>53169:允许开发人员通过设置 Connection: close 标头来避免对未知长度的响应进行分块编码.基于 Philippe Marschall 建议的补丁.(市场)

来自 BaseStreamingHTTPEndPoint.java 中的 BlazeDS (4.0.0.14931) 代码:

718: res.setHeader("Connection", "close");

所以,我写了一个简单的过滤器:

@Overridepublic void doFilter(ServletRequest 请求,ServletResponse 响应,FilterChain 链) 抛出 IOException, ServletException {chain.doFilter(request, new HttpServletResponseWrapper((HttpServletResponse) 响应) {public void setHeader(String name, String value) {if (!("Connection".equalsIgnoreCase(name) && "Close".equalsIgnoreCase(value))) {super.setHeader(name, value);}}});}

使用 web.xml 中的配置:

<filter-name>MessageBrokerHack</filter-name><过滤器类>com.vivimice.testing.MessageBrokerHack</过滤器类></过滤器><过滤器映射><filter-name>MessageBrokerHack</filter-name><url-pattern>/messagebroker/*</url-pattern></过滤器映射>

然后问题就解决了.

在 AIR 客户端 (Flex 4.5.1) 和 Tomcat 6.0.36 & 上测试7.0.35

注意:尚未对常规 RemoteObject 调用进行测试.

I found my flex application doesn't work anymore after tomcat version $subject. Please help me to get through this. I tried many things without any success.

Here is my configurations.

Blaze - 4.x Tomcat - Latest - 7.0.32 Java 7

Application just hangs without any error or anything. It works again from 7.0.32. I checked tomcat release notes (http://tomcat.apache.org/tomcat-7.0-doc/changelog.html) and isolated problem up to Coyote jar file.

When I replace Coyote.jar from version 7.0.27 to 7.0.32 it works properly.

following are changes for Coyote (http://tomcat.apache.org/tomcat-7.0-doc/changelog.html)

52858: Correct fix for high CPU load (fhanik)
53138: Broken Sendfile on SSL introduced in 7.0.27 (fhanik)
52055: Additional fix required to ensure that InputFilters are recycled between requests. (markt)
53061: Fix a problem in the NIO connector whereby if the poller was under low but consistent load (>1 request/per second and always less than 1 second between requests) timeouts never took place. (markt)
53063: When using an Executor with BIO, use the executor's maxThreads as the default for maxConnections. (markt)
53119: Prevent buffer overflow errors being reported when a client disconnects before the response has been fully written from an AJP connection using the APR/native connector. (markt)
53169: Allow developers to avoid chunked encoding for a response of unknown length by setting the Connection: close header. Based on a patch suggested by Philippe Marschall. (markt)
53173: Properly count down maxConnections (fhanik)
 Update default value of pollerThreadCount for the NIO connector. The new default value will never go above 2 regardless of available processors. (fhanik)
 Allow to retrieve the current connectionCount via getter from the endpoint and as JMX attribute of the ThreadPool mbean. (rjung)
 Correct an edge case where Comet END events were not send to connected clients when the Tomcat connector was stopped. (markt)
53406: Fix possible stack overflow on connection close when using Comet. (fhanik)
 Improve InternalNioInputBuffer.parseHeaders(). (kkolinko)
 Implement maxHeaderCount attribute on Connector. It is equivalent of LimitRequestFields directive of Apache HTTPD. Default value is 100. (kkolinko)

Any guess / idea would help. Thanks in advance!

解决方案

I think this may be the cause of the problem:

53169: Allow developers to avoid chunked encoding for a response of unknown length by setting the Connection: close header. Based on a patch suggested by Philippe Marschall. (markt)

And from BlazeDS (4.0.0.14931) code in BaseStreamingHTTPEndPoint.java:

718: res.setHeader("Connection", "close");

So, I wrote a simple filter:

@Override
public void doFilter(ServletRequest request, ServletResponse response,
        FilterChain chain) throws IOException, ServletException {
    chain.doFilter(request, new HttpServletResponseWrapper(
            (HttpServletResponse) response) {
        public void setHeader(String name, String value) {
            if (!("Connection".equalsIgnoreCase(name) && "Close"
                    .equalsIgnoreCase(value))) {
                super.setHeader(name, value);
            }
        }
    });
}

With configurations in web.xml:

<filter>
    <filter-name>MessageBrokerHack</filter-name>
    <filter-class>
        com.vivimice.testing.MessageBrokerHack
    </filter-class>
</filter>
<filter-mapping>
    <filter-name>MessageBrokerHack</filter-name>
    <url-pattern>/messagebroker/*</url-pattern>
</filter-mapping>

And then the problem solved.

Tested on AIR client (Flex 4.5.1) and Tomcat 6.0.36 & 7.0.35

Note: Not tested on regular RemoteObject calls yet.

这篇关于Tomcat 在 7.0.27 版本之后不进行 blazeds 流传输?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆