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

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

问题描述

我有一个非常大的问题。我写了一个使用Flex3 / Tomcat / BlazeDS / Spring的大型应用程序,在本地开发时工作得很好,当我部署到通用的开发环境时很好,但是当部署到我们的测试环境时经常失败。

当远程请求需要很长时间(超过20秒)时,失败似乎最为频繁。在我的开发服务器上,错误发生,但只有当请求需要很长时间(超过45秒)。但是,这个错误也可能会立即发生(发送请求并立即失败)。大多数的错误也有HTTP状态:502(坏网关),但有些只是说HTTP失败。



我没有做任何特别的BlazeDS以外的把战争文件放在webapps目录中。该应用程序通过https访问。远程调用只能通过目标来引用服务器。我们的DEV和TEST实例上的tomcat服务器具有相同的java参数(相同的Xms和Xmx等)。以下是我的相关文件:

services-config.xml

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

web.xml

 <?xml version =1.0encoding =UTF-8?> 
< web-app version =2.5xmlns =http://java.sun.com/xml/ns/javaeexmlns:xsi =http://www.w3.org/2001/ XMLSchema-instancexsi: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>
<加载启动> 1< /加载启动>
< / servlet>

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

flexContext.xml

 <! -  
我在这里有组件扫描标签来扫描我的类文件。我用于flex的控制器有一个注释来将其定义为远程目标。这里是:
@Controller
@RemotingDestination(value =dest,channels =my-secure-amf)
public class FlexController {
- >

< bean id =flexExceptionTranslatorclass =edu.liberty.zconduct.web.FlexExceptionTranslator/>

< flex:exception-translator ref =flexExceptionTranslator/>
<! - < flex:secured />如果以前有过这种情况,但是它不能正常工作,无论是 - >
< / flex:message-broker>

我的绳索已经接近尾声了。错误是一个应用程序断开器。请帮助我,如果可以的话。

编辑
我切换到http仍然得到错误。 Tomcat现在说:

lockquote

警告:发送结束包错误

java。 net.SocketException:断开的管道

我在我的apache日志中寻找jk_mod,看到一些调试信息,看起来像我发送的请求,然后如下:

lockquote

ajp_send_request :: jk_ajp_common.c
(1592):Resent请求体(432)

[debug]
jk_shutdown_socket :: jk_connect.c
(681):关闭套接字68



[debug]
jk_shutdown_socket :: jk_connect.c
(732):关闭套接字68并读取0
逗留字节




ajp_connection_tcp_get_message :: jk_ajp_common.c
(1150):(myTestServer)不能从$ b $接收
响应头信息b tomcat,网络问题或tomcat
(xx.xx.xx.xx:xxxx)down(errno = 11)

[error] ajp_get_re ply :: jk_ajp_common.c
(1962):(myTestServer)Tomcat停止
或拒绝连接。没有响应已经被发送到客户端(还)

$信息ajp_service :: jk_ajp_common.c
(2447):(myTestServer)发送请求
给tomcat失败(可恢复),
(attempt = 2)

ajp_service :: jk_ajp_common.c
(2466):( myTestServer)连接到
tomcat失败。
$ b $ [b] [b]
ajp_reset_endpoint :: jk_ajp_common.c
(743 ):(myTestServer)用sd = 4294967295重新设置
端点(socket
shutdown)
$ b $ [debug] ajp_done :: jk_ajp_common.c
(2905):为工作人员myTestServer回收连接池
slot = 0
$ b $ jk_handler :: mod_jk.c(2615):
对于
worker = myTestServer


解决方案

的服务错误= 0 Cornel Creanga帮助我抵达在这个解决方案。我把我的应用程序切换到http,并开始在catalina.out文件中接收消息。我不知道为什么这会影响它,但它确实如此。这些消息都说,插座中有一个破损的管道。进一步的调查显示,涉及到jk_mod。

通过大量搜索,我发现我们的系统管理员已经将服务器上的套接字超时设置为10秒,但是我们的测试服务器上, 5分钟,我们的DEV服务器,所以大量的搜索正在导致它超时一旦到达测试。



系统管理员调整了配置上的测试,使另一个worker(5分钟超时)处理这个上下文路径的调用。


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.

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.

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

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

<!--
    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.

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

WARNING: Error sending end packet

java.net.SocketException: Broken pipe

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:

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

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

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

[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)

[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)

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

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

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

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

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

解决方案

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.

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.

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天全站免登陆