Ant Flex 问题
我的 Cairngorm 程序在允许 Cairngorm 的 ServiceLocator 开始使用相同的 RemoteObject 获取业务数据之前,对 RemoteObject 进行一些初步身份验证。 Flex Builder 一切正常,但我需要 Ant 构建。 Ant mxmlc 任务编译一切正常,但在运行时,生成的代码在 Cairngorm 的 RemoteObjects 类上的 getService() 方法处失败,因为它找不到服务。
这可能是由于 Cairngorm 代码在 Ant 驱动的编译中以不同方式链接所致? 在 -dump-config 生成的文件中(并且该文件很好,在命令行上与 mxmlc 一起使用),对 Cairngorm swc 的唯一引用在此元素中:
<library-path> <path-element>\path\to\directory\containing\Cairngorm.swc</path-element> </library-path>
我的 build.xml 中的相应元素是
<compiler.library-path dir="${basedir}" append="true"> <include name="libs"/> </compiler.library-path>
I can't see除了在 FB 输出和我的 build.xml 中将 static-link-runtime-shared-libraries 显式设置为 true 之外,任何会影响 Cairngorm 链接方式的内容。 也许我的链接理论全错了? 但是,当从同一 SWF 中的其他位置对同一 RemoteObject 的访问正常时,还有什么可能导致 Cairngorm 的远程访问失败?
My Cairngorm program does some preliminary authentication against a RemoteObject before allowing Cairngorm's ServiceLocator to start using the same RemoteObject to get business data. Everything works fine with Flex Builder, but I need an Ant build. The Ant mxmlc task compiles everything ok, but at runtime the resulting code fails at the getService() method on Cairngorm's RemoteObjects class, because it can't find the service.
Might this perhaps be due to the Cairngorm code being differently linked in the Ant-driven compilation? In the file resulting from -dump-config (and this file is fine, used with mxmlc on the command line) the only reference to the Cairngorm swc is in this element:
<library-path> <path-element>\path\to\directory\containing\Cairngorm.swc</path-element> </library-path>
The corresponding element in my build.xml is
<compiler.library-path dir="${basedir}" append="true"> <include name="libs"/> </compiler.library-path>
I can't see anything that would affect how Cairngorm is linked, apart from an explicit setting of static-link-runtime-shared-libraries to true in both the FB output and in my build.xml. Perhaps my linking theory is all wrong? But what else could be making Cairngorm's remote access fail when access from elsewhere in the same SWF to the same RemoteObject has been ok?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来 ANT 构建可能缺少在配置 RemoteObject 端点的 services-config.xml 文件中编译的 -services 标志。
在 FlexBuilder 中,查看项目属性并导航到 Flex Compiler 窗格。 您应该看到“其他编译器参数”字段。 确保将这些相同的附加参数传递给 ANT 编译任务。 您正在寻找类似“-services services-config.xml”的内容
It sounds like the ANT build might be missing the -services flag to compile in the services-config.xml file that configures the RemoteObject endpoints.
In FlexBuilder, look at the project properties and navigate to the Flex Compiler pane. You should see an "Additional Compiler Arguments" field. Make sure that these same additional arguments are passed to the ANT compile task. You're looking for something like "-services services-config.xml"