Java 在使用SSL的负载平衡环境中设置flex应用程序时出现问题

Java 在使用SSL的负载平衡环境中设置flex应用程序时出现问题,java,apache-flex,ssl,https,load-balancing,Java,Apache Flex,Ssl,Https,Load Balancing,我已经使用flex 3.0在我的应用程序中开发了仪表板。为此,我在flex应用程序中使用了JSP包装器。我的应用程序运行在JBoss应用服务器上。对于flex应用程序和我的应用程序之间的通信,我使用LCD。HTTPService组件用于从服务器接收数据。对于amf和http通道以及安全模式和非安全模式,service-config.xml中给出了通道定义。在proxy-config.xml中,我定义了通道和目标 services-config.xml ... ... <channel-

我已经使用flex 3.0在我的应用程序中开发了仪表板。为此,我在flex应用程序中使用了JSP包装器。我的应用程序运行在JBoss应用服务器上。对于flex应用程序和我的应用程序之间的通信,我使用LCD。HTTPService组件用于从服务器接收数据。对于amf和http通道以及安全模式和非安全模式,service-config.xml中给出了通道定义。在proxy-config.xml中,我定义了通道和目标

services-config.xml

...
...

<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
          <polling-enabled>false</polling-enabled>
    </properties>
</channel-definition>

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

<channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>

<channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
    <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
    <properties>
        <add-no-cache-headers>false</add-no-cache-headers>
    </properties>
</channel-definition>


...
...



proxy-config.xml



...
...

<default-channels>
    <channel ref="my-http"/>
    <channel ref="my-amf"/>
    <channel ref="my-secure-http"/>
    <channel ref="my-secure-amf"/>
</default-channels>

...
...

<destination id="dashboardService">
    <properties>
<url>/kr/servlet/DashboardServlet</url>
    </properties>
</destination>

<destination id="dashboardJSPService">
    <properties>
<url>/kr/krportal/dashboardJSPService.jsf</url>
    </properties>
</destination>



...

...
services-config.xml
...
...
假的
假的
假的
...
...
proxy-config.xml
...
...
...
...
/kr/servlet/DashboardServlet
/kr/krportal/dashboardJSPService.jsf
...
...
在我的开发环境中,安全模式和非安全模式都运行良好。现在,当我在负载平衡器后面部署它时(它只接受安全请求,如果请求不安全,它会将其重定向到安全url),MessageBrokerservlet没有响应。我还观察到的一件事是,当环境是非负载平衡的时,会出现类似于http://{server.name}:{server.port}/{context.root}/messagebroker/http.的请求,这些请求是post请求。但在使用ssl的负载平衡环境中,请求再次类似于
'http://{server.name}:{server.port}/{context.root}/messagebroker/http'
,这是一个post请求,它被重定向到
'https://{server.name}:{server.port}/{context.root}/messagebroker/http'
,这是一个get请求。此get请求返回的内容为空

想听听你的意见吗


谢谢,flex和LCD都使用此配置文件。Flex使用它向特定端点发送消息,而LCD使用此文件实际创建端点。您会注意到在URL的末尾出现了/amf、/amfsecure、/http和/httpsecure。如果您的负载平衡器将调用重定向到,它将失败,因为ssl端点以/amfsecure结尾