【问题标题】:BlazeDS + Flash Builder: on setting web-application parametersBlazeDS + Flash Builder:关于设置 Web 应用程序参数
【发布时间】:2012-06-17 19:40:02
【问题描述】:

我有一个工作的 Flex/BlazeDS 应用程序(用于简单的 AMF 远程处理),具有以下设置:

服务器配置.xml:

<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
    <endpoint url="https://www.mydomain.com:443/myapp/messagebroker/amfsecure.amf" 
          class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
        <add-no-cache-headers>false</add-no-cache-headers>
        <polling-enabled>false</polling-enabled>
    </properties>
</channel-definition>

在 Flash Builder 4.6 > 属性 > Flex 服务器中:

Root URL: http://www.mydomain.com/myapp
Context Root: /myapp/

问题是我所有的 java 文件都放在一个目录中:

WEB-INF/classes/

并简单地使用系统默认包(例如,在 java 文件中没有指定包)。最终,文件的绝对数量变得不堪重负。为了改善我的组织,我开始使用包,并在此过程中创建了以下目录:

WEB-INF/classes/com/mydomain/
WEB-INF/classes/com/mydomain/mytools/
WEB-INF/classes/com/mydomain/hr/
WEB-INF/classes/com/mydomain/utilities/
etc...

现在WEB-INF/classes/ 目录中没有 java 文件(它们已被移动到它的各个子目录中)。

我的问题是如何修改services-config.xml 文件和/或 Flash Builder > 属性 > Flex 服务器设置?我尝试了许多不同的设置,但总是收到以下错误:

Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url:...

我的想法是大多数人使用WEB-INF/classes/com/mydomain/ 架构来组织他们的项目,所以我希望有人可以与我分享他们的设置是什么样的。

Adobe 的网站提供了以下信息,但我看不出我做错了什么:The root folder specifies the top-level directory of the web application (the directory that contains the WEB-INF directory). The root URL specifies the URL of the web application, and the context root specifies the root of the web application.

提前感谢任何 cmets/提示尝试什么。

更新1:

这是我的目的地(来自 remoting-config.xml):

<destination id="mySecureDestination">
    <channels>
        <channel ref="my-secure-amf"/>
    </channels>
        <properties>
            <source>myApplicationClass</source> 
            <scope>application</scope>
        </properties>
</destination>

【问题讨论】:

  • 您能告诉我们您的目的地的定义吗?

标签: actionscript-3 apache-flex blazeds


【解决方案1】:

destination 定义的源标记中,您必须编写目标类的完整类路径。因此,假设您将 myApplicationClass 移至 WEB-INF/classes/com/mydomain/,则应为:

<destination id="mySecureDestination">
    <channels>
        <channel ref="my-secure-amf"/>
    </channels>
        <properties>
            <source>com.mydomain.myApplicationClass</source> 
            <scope>application</scope>
        </properties>
</destination>

【讨论】:

  • 谢谢RIAstar,我会试一试的。您能否确认我不需要更改services-config.xml 或服务器的任何 Flash Builder 设置,如上所示?
  • @ggkmath 不是我能看到的,如果在你移动课程之前一切正常。 (我假设您在客户端的服务配置中使用目标名称)
  • 完美运行!非常感谢RIAstar
猜你喜欢
  • 1970-01-01
  • 2013-02-15
  • 1970-01-01
  • 1970-01-01
  • 2023-03-31
  • 2012-02-22
  • 1970-01-01
  • 2011-05-14
  • 1970-01-01
相关资源
最近更新 更多