apache-flex - Tomcat 在 7.0.27 版本之后不做 blazeds streaming?

标签 apache-flex jakarta-ee tomcat tomcat7 blazeds

我发现我的 flex 应用程序在 tomcat 版本 $subject 之后不再工作。请帮助我度过难关。我尝试了很多事情都没有成功。

这是我的配置。

火焰 - 4.x Tomcat - 最新 - 7.0.32 Java 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: 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)

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

最佳答案

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

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");

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

@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);
            }
        }
    });
}

在 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>

然后问题就解决了。

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

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

关于apache-flex - Tomcat 在 7.0.27 版本之后不做 blazeds streaming?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13024000/

相关文章:

apache-flex - flex 4 组中的中心元素

java - 当用户从资源类访问资源时,Rest Service 将如何执行?

servlets - 在 Servlet 过滤器中设置响应代码

java - 如何在 WAS 6.0 上运行我的 JSF 1.1 应用程序

apache-flex - 未绑定(bind)元素的前缀

ios - 直到文本字段失去焦点(使用 Flex)后,才会出现在 iOS 上更改文本样式

apache-flex - 使用 Canvas 与 VBox/HBox 相比,Flex 3 性能显着提高?

tomcat - grails run-war 的错误

java - Spring boot RESTful 服务作为 WAR 而不是 JAR

java - 在 Spring Framework 中使用 @PathVariable 时编码不正确