NetConnection.Call.Failed 在 Flex3/Tomcat/BlazeDS/Spring 中偶尔发生 [英] NetConnection.Call.Failed happening sporadically in Flex3/Tomcat/BlazeDS/Spring

查看:24
本文介绍了NetConnection.Call.Failed 在 Flex3/Tomcat/BlazeDS/Spring 中偶尔发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常大的问题.我已经使用 Flex3/Tomcat/BlazeDS/Spring 编写了一个大型应用程序,它在本地开发时运行良好,当我部署到通用开发环境时很好,但在部署到我们的测试环境时经常失败.

I have a very large problem. I've written a large app using Flex3/Tomcat/BlazeDS/Spring that has worked very well while developing locally, fine when I deployed to a common dev environment, but then fails very often when deployed to our test environment.

当远程处理请求需要很长时间(超过 20 秒)时,失败似乎最常发生.在我的开发服务器上,错误发生,但仅当请求需要很长时间(超过 45 秒)时才会发生.但是,该错误有时也会立即发生(发送请求并立即失败).大多数错误也有 HTTP 状态:502(坏网关),但有些只是说 HTTP 失败.

The failures seem to happen most when a remoting request takes a good bit of time (more than 20 seconds). On my dev server, the errors happen, but only when the request takes a very long time (more than 45 seconds). However, the error also occurs seemingly instantly at times (send a request and it fails immediately). Most of the errors also have HTTP Status: 502 on them (Bad Gateway), but some just say HTTP Failed.

除了将 war 文件放在 webapps 目录中之外,我没有对 BlazeDS 做任何特别的事情.该应用程序通过 https 访问.远程调用仅通过目的地"引用服务器.我们的 DEV 和 TEST 实例上的 tomcat 服务器具有相同的 java 参数(相同的 Xms 和 Xmx 等).以下是我的相关文件:

I haven't done anything special with BlazeDS other than put the war file in the webapps directory. The application is accessed over https. Remoting calls refer to the server by "destination" only. The tomcat servers on our DEV and TEST instances have identical java arguments (same Xms and Xmx, etc). Below are my relevant files:

services-config.xml

services-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
    <services>
        <default-channels>
           <channel ref="my-secure-amf"/>
        </default-channels>
    </services>
    <channels>
        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
    </channels>
<services-config>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    ...

    <servlet>
        <servlet-name>spring-flex</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/flexContext.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring-flex</servlet-name>
        <url-pattern>/messagebroker/*</url-pattern>
    </servlet-mapping>
</web-app>

flexContext.xml

flexContext.xml

<!--
    I have component-scan tags here to scan my class files. The Controller I'm using for flex has an annotation on it to define it as a remote destination. Here it is:
    @Controller
    @RemotingDestination(value = "dest", channels="my-secure-amf")
    public class FlexController {
-->

<bean id="flexExceptionTranslator" class="edu.liberty.zconduct.web.FlexExceptionTranslator" />

<flex:message-broker>
    <flex:exception-translator ref="flexExceptionTranslator"/>
    <!-- <flex:secured /> Had this previously, but it wasn't working then, either -->
</flex:message-broker>

我快用完了.错误是应用程序破坏者.如果可以,请帮助我.

I'm near the end of my rope. The error is an app-breaker. Please, please help me if you can.

编辑我切换到 http 并仍然收到错误.Tomcat 现在说:

EDIT I switched over to http and still get the error. Tomcat is now saying:

警告:发送结束数据包时出错

WARNING: Error sending end packet

java.net.SocketException: 管道损坏

java.net.SocketException: Broken pipe

我在我的 apache 日志中查看 jk_mod 并看到一些类似于我发送的请求的调试信息,然后是以下内容:

I look in my apache log for jk_mod and see some debug information that looks like the request I sent in, and then the following:

[调试]ajp_send_request::jk_ajp_common.c(1592): 重新发送请求体 (432)

[debug] ajp_send_request::jk_ajp_common.c (1592): Resent the request body (432)

[调试]jk_shutdown_socket::jk_connect.c(681): 即将关闭套接字 68

[debug] jk_shutdown_socket::jk_connect.c (681): About to shutdown socket 68

[调试]jk_shutdown_socket::jk_connect.c(732):关闭套接字 68 并读取 0挥之不去的字节

[debug] jk_shutdown_socket::jk_connect.c (732): Shutdown socket 68 and read 0 lingering bytes

[信息]ajp_connection_tcp_get_message::jk_ajp_common.c(1150): (myTestServer) 无法接收响应头消息来自tomcat,网络问题或tomcat(xx.xx.xx.xx:xxxx) 已关闭 (errno=11)

[info] ajp_connection_tcp_get_message::jk_ajp_common.c (1150): (myTestServer) can't receive the response header message from tomcat, network problems or tomcat (xx.xx.xx.xx:xxxx) is down (errno=11)

[错误] ajp_get_reply::jk_ajp_common.c(1962): (myTestServer) Tomcat 已关闭或拒绝连接.没有回应已发送给客户端(尚未)

[error] ajp_get_reply::jk_ajp_common.c (1962): (myTestServer) Tomcat is down or refused connection. No response has been sent to the client (yet)

[信息] ajp_service::jk_ajp_common.c(2447): (myTestServer) 发送请求to tomcat 失败(可恢复),(尝试=2)

[info] ajp_service::jk_ajp_common.c (2447): (myTestServer) sending request to tomcat failed (recoverable), (attempt=2)

[错误] ajp_service::jk_ajp_common.c(2466): (myTestServer) 连接到tomcat 失败了.

[error] ajp_service::jk_ajp_common.c (2466): (myTestServer) connecting to tomcat failed.

[调试]ajp_reset_endpoint::jk_ajp_common.c(743): (myTestServer) 重置具有 sd = 4294967295 的端点(套接字关机)

[debug] ajp_reset_endpoint::jk_ajp_common.c (743): (myTestServer) resetting endpoint with sd = 4294967295 (socket shutdown)

[调试] ajp_done::jk_ajp_common.c(2905):回收连接池slot=0 用于工人 myTestServer

[debug] ajp_done::jk_ajp_common.c (2905): recycling connection pool slot=0 for worker myTestServer

[信息] jk_handler::mod_jk.c (2615):服务错误=0worker=myTestServer

[info] jk_handler::mod_jk.c (2615): Service error=0 for worker=myTestServer

推荐答案

Cornel Creanga 帮助我找到了这个解决方案.我将我的应用程序切换到 http 并开始在 catalina.out 文件中接收消息.我不知道为什么这会影响它,但确实如此.消息都说套接字中有一个损坏的管道.进一步调查表明,jk_mod 参与其中.

Cornel Creanga helped me arrive at this solution. I switched my app to http and started receiving messages in the catalina.out file. I don't know why this affected it, but it did. The messages all said that there was a broken pipe in the socket. Further investigation showed that the jk_mod was involved.

通过大量搜索,我发现我们的系统管理员在我们的 TEST 服务器上将服务器上的套接字超时设置为 10 秒,但在我们的 DEV 服务器上设置为 5 分钟,因此正在进行的大量搜索导致它一旦超时必须进行测试.

Through much searching, I discovered that our SysAdmins had set the socket timeout on the server to 10 seconds on our TEST servers, but 5 minutes on our DEV servers, so the massive searches being done were causing it to time out once it got to TEST.

系统管理员调整了 TEST 上的配置,以便另一个工作人员(超时 5 分钟)处理此上下文路径的调用.

The SysAdmins adjusted the configuration on TEST so that another worker (with a 5 minute timeout) handles the calls for this context path.

这篇关于NetConnection.Call.Failed 在 Flex3/Tomcat/BlazeDS/Spring 中偶尔发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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