Flex CrossDomain.xml 错误 - Channel.Security.Error 错误错误 #2048
我正在努力让 Flex SWF(嵌入在 JSP 中)访问远程数据(来自另一个域)。
我有一个 crossdomain.xml (它嵌入在我的 SWF 中)。其内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
在我的 main.xml 中,我使用以下方法加载 crossdomain.xml 文件:
Security.loadPolicyFile("http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml");
当我通过浏览器访问 JSP 网页时,嵌入式 SWF 尝试执行 Java 远程调用,但出现以下错误:
Error string = Send failed
Error code = Client.Error.MessageSend
Error details = Channel.Security.Error error Error #2048:
Security sandbox violation: http://www.mysite.com/CSS/ReviewItemsServer/ReviewItemsMain.swf
cannot load data from http://www.mysite.com:8380/CSS/ReviewItemsServer/messagebroker/amf. url:
I am beautiful确保 crossdomain.xml 文件实际上由 SWF 加载,因为我创建了一个简单的 URLLoader 来加载 xml 文件并检查是否没有错误。所以我不认为这是一个问题...
当我在调试模式下运行 SWF 时...我还看到以下错误消息:
Error: [strict] Ignoring policy file at http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml due to missing Content-Type. See http://www.adobe.com/go/strict_policy_files to fix this problem.
任何帮助将不胜感激...
马克
I am struggling with getting a Flex SWF (which is embedded in JSP) to access remote data (from another domain).
I have a crossdomain.xml (which is embedded in my SWF). Its content is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
In my main.xml I load the crossdomain.xml file using:
Security.loadPolicyFile("http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml");
When I access the JSP webpage via the browser, the embedded SWF tries to do a Java remoting call and I get the following error:
Error string = Send failed
Error code = Client.Error.MessageSend
Error details = Channel.Security.Error error Error #2048:
Security sandbox violation: http://www.mysite.com/CSS/ReviewItemsServer/ReviewItemsMain.swf
cannot load data from http://www.mysite.com:8380/CSS/ReviewItemsServer/messagebroker/amf. url:
I am pretty sure that the crossdomain.xml file actually get loaded by the SWF as I have created a simple URLLoader to load the xml file and check that there is no error. So I dont think that is an issue...
When I run the SWF in debug mode...I also see the following error message:
Error: [strict] Ignoring policy file at http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml due to missing Content-Type. See http://www.adobe.com/go/strict_policy_files to fix this problem.
Any help would be greatly appreaciated....
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要位于 http://www.mysite.com:8380/crossdomain.xml< 的主策略文件/a> 包含以下内容:
这将允许使用子目录中的跨域策略文件。
You need a master policy file at http://www.mysite.com:8380/crossdomain.xml with the following contents:
That will permit crossdomain policy files in subdirectories to be used.